From 8ed937344a57142a575e5272f50933c9c4459a43 Mon Sep 17 00:00:00 2001 From: tanjinzhou <415800467@qq.com> Date: Wed, 19 Aug 2020 15:23:26 +0800 Subject: [PATCH] fix: tabs change trigger --- components/vc-tabs/src/TabContent.jsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/vc-tabs/src/TabContent.jsx b/components/vc-tabs/src/TabContent.jsx index 943bb65232..fb27bf599a 100644 --- a/components/vc-tabs/src/TabContent.jsx +++ b/components/vc-tabs/src/TabContent.jsx @@ -8,6 +8,7 @@ import { } from './utils'; export default { name: 'TabContent', + inheritAttrs: false, props: { animated: PropTypes.bool.def(true), animatedWithMargin: PropTypes.bool.def(true), @@ -21,7 +22,9 @@ export default { computed: { classes() { const { animated, prefixCls } = this; + const { class: className } = this.$attrs; return { + [className]: !!className, [`${prefixCls}-content`]: true, [animated ? `${prefixCls}-content-animated` : `${prefixCls}-content-no-animated`]: true, }; @@ -68,9 +71,13 @@ export default { const animatedStyle = animatedWithMargin ? getMarginStyle(activeIndex, tabBarPosition) : getTransformPropValue(getTransformByIndex(activeIndex, tabBarPosition, direction)); - style = animatedStyle; + style = { + ...this.$attrs.style, + ...animatedStyle, + }; } else { style = { + ...this.$attrs.style, display: 'none', }; }