diff --git a/src/components/tag/tag.vue b/src/components/tag/tag.vue index b0e6f64..1b4d4ab 100644 --- a/src/components/tag/tag.vue +++ b/src/components/tag/tag.vue @@ -3,7 +3,7 @@
- +
@@ -71,38 +71,38 @@ dotClasses () { return `${prefixCls}-dot-inner`; }, - showDot () { - return !!this.type && this.type === 'dot'; - }, - lineColor () { + iconClass () { if (this.type === 'dot') { return ''; } else if (this.type === 'border') { - return this.color !== undefined ? this.transferColor(this.color) : ''; + return `${prefixCls}-color-${this.color}`; } else { return this.color !== undefined ? (this.color === 'default' ? '' : 'rgb(255, 255, 255)') : ''; } }, - borderColor () { + showDot () { + return !!this.type && this.type === 'dot'; + }, + lineColor () { if (this.type === 'dot') { return ''; } else if (this.type === 'border') { - return this.color !== undefined ? this.transferColor(this.color) : ''; + return this.color !== undefined ? (oneOf(this.color, initColorList) ? '' : this.color) : ''; } else { - return ''; + return this.color !== undefined ? (this.color === 'default' ? '' : 'rgb(255, 255, 255)') : ''; } }, + dotColor () { + return this.color !== undefined ? (oneOf(this.color, initColorList) ? '' : this.color) : ''; + }, textColorStyle () { return oneOf(this.color, initColorList) ? {} : {color: this.lineColor}; }, - mainColor () { - return this.color !== undefined ? this.transferColor(this.color) : ''; - }, bgColorStyle () { - return oneOf(this.color, initColorList) ? {} : {background: this.mainColor}; + return oneOf(this.color, initColorList) ? {} : {background: this.dotColor}; }, defaultTypeColor () { - return (this.type !== 'dot' && this.type !== 'border') ? (this.color !== undefined ? this.transferColor(this.color) : '') : ''; + return (this.type !== 'dot' && this.type !== 'border') ? (this.color !== undefined ? (oneOf(this.color, initColorList) ? '' : this.color) : '') : ''; } }, methods: { @@ -122,19 +122,6 @@ } else { this.$emit('on-change', checked, this.name); } - }, - transferColor (name) { - if (oneOf(name, initColorList)) { - switch (name) { - case 'red': return '#ed3f14'; - case 'green': return '#19be6b'; - case 'yellow': return '#ff9900'; - case 'blue': return '#2d8cf0'; - case 'default': return ''; - } - } else { - return name; - } } } }; diff --git a/src/styles/components/tag.less b/src/styles/components/tag.less index c5c4b45..e878cab 100644 --- a/src/styles/components/tag.less +++ b/src/styles/components/tag.less @@ -30,15 +30,19 @@ &-color{ &-red{ color: @error-color !important; + border-color: @error-color !important; } &-green{ color: @success-color !important; + border-color: @success-color !important; } &-blue{ color: @link-color !important; + border-color: @link-color !important; } &-yellow{ color: @warning-color !important; + border-color: @warning-color !important; } &-white{ color: rgb(255, 255, 255) !important; -- libgit2 0.21.4