refactor(button): 优化size属性校验 (#162)

Co-authored-by: 骆沛 <luopei@11.com>
This commit is contained in:
luopei 2023-04-21 09:59:42 +08:00 committed by GitHub
parent b87367b53a
commit c294f6b402
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -42,7 +42,13 @@ export default defineComponent({
type: String,
default: 'button'
},
size: String,
size: {
type: String,
default: '',
validator(val: string) {
return ['large', 'medium', 'small', 'mini', ''].includes(val)
}
},
round: Boolean,
plain: Boolean,
circle: Boolean,
@ -53,5 +59,4 @@ export default defineComponent({
setup(props, context) {
return $setup({ props, context, template })
}
}
)
})