mirror of
				https://gitee.com/hhyykk/ipms-sjy-ui.git
				synced 2025-11-04 12:18:43 +08:00 
			
		
		
		
	perf: propTypes
This commit is contained in:
		@@ -1,12 +1,10 @@
 | 
				
			|||||||
import { createTypes, VueTypesInterface, VueTypeValidableDef } from 'vue-types'
 | 
					import { VueTypeValidableDef, VueTypesInterface, createTypes, toValidableType } from 'vue-types'
 | 
				
			||||||
import { CSSProperties } from 'vue'
 | 
					import { CSSProperties } from 'vue'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// 自定义扩展vue-types
 | 
					 | 
				
			||||||
type PropTypes = VueTypesInterface & {
 | 
					type PropTypes = VueTypesInterface & {
 | 
				
			||||||
  readonly style: VueTypeValidableDef<CSSProperties>
 | 
					  readonly style: VueTypeValidableDef<CSSProperties>
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					const newPropTypes = createTypes({
 | 
				
			||||||
const propTypes = createTypes({
 | 
					 | 
				
			||||||
  func: undefined,
 | 
					  func: undefined,
 | 
				
			||||||
  bool: undefined,
 | 
					  bool: undefined,
 | 
				
			||||||
  string: undefined,
 | 
					  string: undefined,
 | 
				
			||||||
@@ -15,14 +13,12 @@ const propTypes = createTypes({
 | 
				
			|||||||
  integer: undefined
 | 
					  integer: undefined
 | 
				
			||||||
}) as PropTypes
 | 
					}) as PropTypes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// 需要自定义扩展的类型
 | 
					class propTypes extends newPropTypes {
 | 
				
			||||||
// see: https://dwightjack.github.io/vue-types/advanced/extending-vue-types.html#the-extend-method
 | 
					  static get style() {
 | 
				
			||||||
// propTypes.extend([
 | 
					    return toValidableType('style', {
 | 
				
			||||||
//   {
 | 
					      type: [String, Object]
 | 
				
			||||||
//     name: 'style',
 | 
					    })
 | 
				
			||||||
//     getter: true,
 | 
					  }
 | 
				
			||||||
//     type: [String, Object],
 | 
					}
 | 
				
			||||||
//     default: undefined
 | 
					
 | 
				
			||||||
//   }
 | 
					 | 
				
			||||||
// ])
 | 
					 | 
				
			||||||
export { propTypes }
 | 
					export { propTypes }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user