mirror of https://github.com/ElemeFE/element
button: add button props validator
parent
f14b5ba540
commit
74cfa6c987
|
@ -38,16 +38,27 @@
|
||||||
props: {
|
props: {
|
||||||
type: {
|
type: {
|
||||||
type: String,
|
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: {
|
icon: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
nativeType: {
|
nativeType: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'button'
|
default: 'button',
|
||||||
|
validator(val) {
|
||||||
|
return ['button', 'submit', 'reset'].includes(val);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
loading: Boolean,
|
loading: Boolean,
|
||||||
disabled: Boolean,
|
disabled: Boolean,
|
||||||
|
|
Loading…
Reference in New Issue