更新:登录功能
This commit is contained in:
51
uni_modules/wot-design-uni/components/common/props.ts
Normal file
51
uni_modules/wot-design-uni/components/common/props.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import type { PropType } from 'vue'
|
||||
|
||||
export const unknownProp = null as unknown as PropType<unknown>
|
||||
|
||||
export const numericProp = [Number, String]
|
||||
|
||||
export const truthProp = {
|
||||
type: Boolean,
|
||||
default: true as const
|
||||
}
|
||||
|
||||
export const makeRequiredProp = <T>(type: T) => ({
|
||||
type,
|
||||
required: true as const
|
||||
})
|
||||
|
||||
export const makeArrayProp = <T>() => ({
|
||||
type: Array as PropType<T[]>,
|
||||
default: () => []
|
||||
})
|
||||
|
||||
export const makeBooleanProp = <T>(defaultVal: T) => ({
|
||||
type: Boolean,
|
||||
default: defaultVal
|
||||
})
|
||||
|
||||
export const makeNumberProp = <T>(defaultVal: T) => ({
|
||||
type: Number,
|
||||
default: defaultVal
|
||||
})
|
||||
|
||||
export const makeNumericProp = <T>(defaultVal: T) => ({
|
||||
type: numericProp,
|
||||
default: defaultVal
|
||||
})
|
||||
|
||||
export const makeStringProp = <T>(defaultVal: T) => ({
|
||||
type: String as unknown as PropType<T>,
|
||||
default: defaultVal
|
||||
})
|
||||
|
||||
export const baseProps = {
|
||||
/**
|
||||
* 自定义根节点样式
|
||||
*/
|
||||
customStyle: makeStringProp(''),
|
||||
/**
|
||||
* 自定义根节点样式类
|
||||
*/
|
||||
customClass: makeStringProp('')
|
||||
}
|
||||
Reference in New Issue
Block a user