Skip to content

Commit

Permalink
fix: tabs change trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
tangjinzhou committed Aug 19, 2020
1 parent 67464fd commit 8ed9373
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion components/vc-tabs/src/TabContent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
} from './utils';
export default {
name: 'TabContent',
inheritAttrs: false,
props: {
animated: PropTypes.bool.def(true),
animatedWithMargin: PropTypes.bool.def(true),
Expand All @@ -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,
};
Expand Down Expand Up @@ -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',
};
}
Expand Down

0 comments on commit 8ed9373

Please sign in to comment.