mirror of https://github.com/ElemeFE/element
button: add button props validator
parent
f14b5ba540
commit
74cfa6c987
|
@ -38,16 +38,27 @@
|
|||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
default: 'default'
|
||||
default: 'default',
|
||||
validator(val) {
|
||||
return ['default', 'primary', 'success', 'warning', 'danger', 'info', 'text'].includes(val);
|
||||
},
|
||||
},
|
||||
size: {
|
||||
type: String,
|
||||
validator(val) {
|
||||
return ['medium', 'small', 'mini'].includes(val);
|
||||
},
|
||||
},
|
||||
size: String,
|
||||
icon: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
nativeType: {
|
||||
type: String,
|
||||
default: 'button'
|
||||
default: 'button',
|
||||
validator(val) {
|
||||
return ['button', 'submit', 'reset'].includes(val);
|
||||
},
|
||||
},
|
||||
loading: Boolean,
|
||||
disabled: Boolean,
|
||||
|
|
Loading…
Reference in New Issue