chore: 更新依赖
This commit is contained in:
@@ -1,29 +1,13 @@
|
||||
import { createTypes, VueTypesInterface, VueTypeValidableDef } from 'vue-types'
|
||||
import { CSSProperties } from 'vue'
|
||||
import VueTypes, { toType } from 'vue-types'
|
||||
import { CSSProperties, PropType } from 'vue'
|
||||
|
||||
// 自定义扩展vue-types
|
||||
type PropTypes = VueTypesInterface & {
|
||||
readonly style: VueTypeValidableDef<CSSProperties>
|
||||
class propTypes extends VueTypes {
|
||||
static get style() {
|
||||
return toType('style', {
|
||||
type: [String, Object] as PropType<[string | CSSProperties]>,
|
||||
default: undefined
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
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