From 2a6f605814358a1c004dc9c2efa3952821946702 Mon Sep 17 00:00:00 2001 From: "zhigang.li" Date: Thu, 21 Dec 2017 18:10:50 +0800 Subject: [PATCH 1/2] fixed the bug about backgroundcolor when tag is checked --- examples/routers/tag.vue | 6 ++++++ src/components/tag/tag.vue | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/examples/routers/tag.vue b/examples/routers/tag.vue index c847fe59..4c8e7936 100644 --- a/examples/routers/tag.vue +++ b/examples/routers/tag.vue @@ -14,7 +14,13 @@ 标签三 标签四

+ 标签一 + 标签二 + 标签三 + 标签四 +

标签一 + 标签一 标签二 标签三 标签四 diff --git a/src/components/tag/tag.vue b/src/components/tag/tag.vue index dc01d990..8ab9bd11 100644 --- a/src/components/tag/tag.vue +++ b/src/components/tag/tag.vue @@ -59,13 +59,13 @@ ]; }, wraperStyles () { - return oneOf(this.color, initColorList) ? {} : {background: this.defaultTypeColor, borderColor: this.lineColor, color: this.lineColor}; + return oneOf(this.color, initColorList) ? {} : {background: this.isChecked ? this.defaultTypeColor : 'transparent', borderWidth: '1px', borderStyle: 'solid', borderColor: this.lineColor, color: this.lineColor}; }, textClasses () { return [ `${prefixCls}-text`, this.type === 'border' ? (oneOf(this.color, initColorList) ? `${prefixCls}-color-${this.color}` : '') : '', - (this.type !== 'dot' && this.type !== 'border' && this.color !== 'default') ? `${prefixCls}-color-white` : '' + (this.type !== 'dot' && this.type !== 'border' && this.color !== 'default') ? (this.isChecked ? `${prefixCls}-color-white` : '') : '' ]; }, dotClasses () { @@ -96,7 +96,7 @@ return this.color !== undefined ? (oneOf(this.color, initColorList) ? '' : this.color) : ''; }, textColorStyle () { - return oneOf(this.color, initColorList) ? {} : {color: this.lineColor}; + return oneOf(this.color, initColorList) ? {} : ((this.type !== 'dot' && this.type !== 'border') ? (this.isChecked ? {color: this.lineColor} : {}) : {color: this.lineColor}); }, bgColorStyle () { return oneOf(this.color, initColorList) ? {} : {background: this.dotColor}; From 40365cfc52d30ac3b9a53e023f2b84ee7c1063bd Mon Sep 17 00:00:00 2001 From: "zhigang.li" Date: Thu, 21 Dec 2017 18:22:27 +0800 Subject: [PATCH 2/2] update --- src/components/tag/tag.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/tag/tag.vue b/src/components/tag/tag.vue index 8ab9bd11..b6ee3f22 100644 --- a/src/components/tag/tag.vue +++ b/src/components/tag/tag.vue @@ -59,7 +59,7 @@ ]; }, wraperStyles () { - return oneOf(this.color, initColorList) ? {} : {background: this.isChecked ? this.defaultTypeColor : 'transparent', borderWidth: '1px', borderStyle: 'solid', borderColor: this.lineColor, color: this.lineColor}; + return oneOf(this.color, initColorList) ? {} : {background: this.isChecked ? this.defaultTypeColor : 'transparent', borderWidth: '1px', borderStyle: 'solid', borderColor: ((this.type !== 'dot' && this.type !== 'border' && this.isChecked) ? this.borderColor : this.lineColor), color: this.lineColor}; }, textClasses () { return [ @@ -92,6 +92,9 @@ return this.color !== undefined ? (this.color === 'default' ? '' : 'rgb(255, 255, 255)') : ''; } }, + borderColor () { + return this.color !== undefined ? (this.color === 'default' ? '' : this.color) : ''; + }, dotColor () { return this.color !== undefined ? (oneOf(this.color, initColorList) ? '' : this.color) : ''; },