From 242ab8c8b53c22e7aa60cc27c969cac872b06a3d Mon Sep 17 00:00:00 2001 From: yangd Date: Mon, 30 Sep 2019 12:45:21 +0800 Subject: [PATCH 1/2] =?UTF-8?q?tabs=E6=B7=BB=E5=8A=A0custContentClass?= =?UTF-8?q?=E5=92=8CcustContentStyle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/tabs/tabs.vue | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/components/tabs/tabs.vue b/src/components/tabs/tabs.vue index ed816aa1..160beae0 100644 --- a/src/components/tabs/tabs.vue +++ b/src/components/tabs/tabs.vue @@ -100,6 +100,14 @@ name: { type: String }, + custContentClass: { + type: String, + default: '' + }, + custContentStyle: { + type: Object, + default: {} + } }, data () { return { @@ -133,7 +141,8 @@ `${prefixCls}-content`, { [`${prefixCls}-content-animated`]: this.animated - } + }, + this.custContentClass ]; }, barClasses () { @@ -154,6 +163,10 @@ transform: `translateX(${p}) translateZ(0px)` }; } + const { custContentStyle } = this; + for (const key in custContentStyle){ + style[key] = custContentStyle[key]; + } return style; }, barStyle () { From 46363dbca36d369b16afcc73911b1a56fe4b1ef5 Mon Sep 17 00:00:00 2001 From: yangd Date: Mon, 30 Sep 2019 23:04:53 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8DcustContentStyle=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/tabs/tabs.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/tabs/tabs.vue b/src/components/tabs/tabs.vue index 160beae0..47e31484 100644 --- a/src/components/tabs/tabs.vue +++ b/src/components/tabs/tabs.vue @@ -106,7 +106,6 @@ }, custContentStyle: { type: Object, - default: {} } }, data () { @@ -164,8 +163,10 @@ }; } const { custContentStyle } = this; - for (const key in custContentStyle){ - style[key] = custContentStyle[key]; + if (custContentStyle) { + for (const key in custContentStyle){ + style[key] = custContentStyle[key]; + } } return style; },