初始化项目,自 v1.7.1 版本开始
This commit is contained in:
28
src/utils/propTypes.ts
Normal file
28
src/utils/propTypes.ts
Normal file
@ -0,0 +1,28 @@
|
||||
import { createTypes, VueTypesInterface, VueTypeValidableDef } from 'vue-types'
|
||||
import { CSSProperties } from 'vue'
|
||||
|
||||
// 自定义扩展vue-types
|
||||
type PropTypes = VueTypesInterface & {
|
||||
readonly style: VueTypeValidableDef<CSSProperties>
|
||||
}
|
||||
|
||||
const propTypes = createTypes({
|
||||
func: undefined,
|
||||
bool: undefined,
|
||||
string: undefined,
|
||||
number: undefined,
|
||||
object: undefined,
|
||||
integer: undefined
|
||||
}) as PropTypes
|
||||
|
||||
// 需要自定义扩展的类型
|
||||
// see: https://dwightjack.github.io/vue-types/advanced/extending-vue-types.html#the-extend-method
|
||||
// propTypes.extend([
|
||||
// {
|
||||
// name: 'style',
|
||||
// getter: true,
|
||||
// type: [String, Object],
|
||||
// default: undefined
|
||||
// }
|
||||
// ])
|
||||
export { propTypes }
|
||||
Reference in New Issue
Block a user