Button add ghost prop

This commit is contained in:
梁灏 2018-06-26 15:47:32 +08:00
parent bfeab68fc2
commit b4fe39f7e1
5 changed files with 115 additions and 37 deletions

View file

@ -35,8 +35,9 @@
props: {
type: {
validator (value) {
return oneOf(value, ['primary', 'ghost', 'dashed', 'text', 'info', 'success', 'warning', 'error', 'default']);
}
return oneOf(value, ['default', 'primary', 'dashed', 'text', 'info', 'success', 'warning', 'error']);
},
default: 'default'
},
shape: {
validator (value) {
@ -68,6 +69,10 @@
type: Boolean,
default: false
},
ghost: {
type: Boolean,
default: false
}
},
data () {
return {
@ -84,7 +89,8 @@
[`${prefixCls}-${this.shape}`]: !!this.shape,
[`${prefixCls}-${this.size}`]: !!this.size,
[`${prefixCls}-loading`]: this.loading != null && this.loading,
[`${prefixCls}-icon-only`]: !this.showSlot && (!!this.icon || !!this.customIcon || this.loading)
[`${prefixCls}-icon-only`]: !this.showSlot && (!!this.icon || !!this.customIcon || this.loading),
[`${prefixCls}-ghost`]: this.ghost
}
];
}