[new feature] Tag: add text-color prop (#2277)

This commit is contained in:
neverland
2018-12-12 18:08:23 +08:00
committed by GitHub
parent 21e79239d6
commit b5e10cd95e
5 changed files with 28 additions and 4 deletions
+9 -2
View File
@@ -33,14 +33,21 @@ export default create({
mark: Boolean,
color: String,
plain: Boolean,
round: Boolean
round: Boolean,
textColor: String
},
computed: {
style() {
const color = this.color || COLOR_MAP[this.type] || GRAY_DARK;
const key = this.plain ? 'color' : 'backgroundColor';
return { [key]: color };
const style = { [key]: color };
if (this.textColor) {
style.color = this.textColor;
}
return style;
}
}
});