Icon add color prop
Icon add color prop
This commit is contained in:
parent
5709f32ede
commit
b79b53ea6f
2 changed files with 14 additions and 8 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue