Skip to content

Commit 8ed9373

Browse files
committed
fix: tabs change trigger
1 parent 67464fd commit 8ed9373

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

components/vc-tabs/src/TabContent.jsx

+8-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
} from './utils';
99
export default {
1010
name: 'TabContent',
11+
inheritAttrs: false,
1112
props: {
1213
animated: PropTypes.bool.def(true),
1314
animatedWithMargin: PropTypes.bool.def(true),
@@ -21,7 +22,9 @@ export default {
2122
computed: {
2223
classes() {
2324
const { animated, prefixCls } = this;
25+
const { class: className } = this.$attrs;
2426
return {
27+
[className]: !!className,
2528
[`${prefixCls}-content`]: true,
2629
[animated ? `${prefixCls}-content-animated` : `${prefixCls}-content-no-animated`]: true,
2730
};
@@ -68,9 +71,13 @@ export default {
6871
const animatedStyle = animatedWithMargin
6972
? getMarginStyle(activeIndex, tabBarPosition)
7073
: getTransformPropValue(getTransformByIndex(activeIndex, tabBarPosition, direction));
71-
style = animatedStyle;
74+
style = {
75+
...this.$attrs.style,
76+
...animatedStyle,
77+
};
7278
} else {
7379
style = {
80+
...this.$attrs.style,
7481
display: 'none',
7582
};
7683
}

0 commit comments

Comments
 (0)