Icon add color prop

Icon add color prop
This commit is contained in:
梁灏 2016-11-11 18:01:20 +08:00
parent 5709f32ede
commit b79b53ea6f
2 changed files with 14 additions and 8 deletions

View file

@ -7,20 +7,25 @@
export default {
props: {
type: String,
size: [Number, String]
size: [Number, String],
color: String
},
computed: {
classes () {
return `${prefixCls} ${prefixCls}-${this.type}`
},
styles () {
let style = {};
if (!!this.size) {
return {
'font-size': `${this.size}px`
}
} else {
return {}
style['font-size'] = `${this.size}px`;
}
if (!!this.color) {
style.color = this.color;
}
return style;
}
}
}