fix: tabs change trigger
parent
67464fdd4b
commit
8ed937344a
|
@ -8,6 +8,7 @@ import {
|
||||||
} from './utils';
|
} from './utils';
|
||||||
export default {
|
export default {
|
||||||
name: 'TabContent',
|
name: 'TabContent',
|
||||||
|
inheritAttrs: false,
|
||||||
props: {
|
props: {
|
||||||
animated: PropTypes.bool.def(true),
|
animated: PropTypes.bool.def(true),
|
||||||
animatedWithMargin: PropTypes.bool.def(true),
|
animatedWithMargin: PropTypes.bool.def(true),
|
||||||
|
@ -21,7 +22,9 @@ export default {
|
||||||
computed: {
|
computed: {
|
||||||
classes() {
|
classes() {
|
||||||
const { animated, prefixCls } = this;
|
const { animated, prefixCls } = this;
|
||||||
|
const { class: className } = this.$attrs;
|
||||||
return {
|
return {
|
||||||
|
[className]: !!className,
|
||||||
[`${prefixCls}-content`]: true,
|
[`${prefixCls}-content`]: true,
|
||||||
[animated ? `${prefixCls}-content-animated` : `${prefixCls}-content-no-animated`]: true,
|
[animated ? `${prefixCls}-content-animated` : `${prefixCls}-content-no-animated`]: true,
|
||||||
};
|
};
|
||||||
|
@ -68,9 +71,13 @@ export default {
|
||||||
const animatedStyle = animatedWithMargin
|
const animatedStyle = animatedWithMargin
|
||||||
? getMarginStyle(activeIndex, tabBarPosition)
|
? getMarginStyle(activeIndex, tabBarPosition)
|
||||||
: getTransformPropValue(getTransformByIndex(activeIndex, tabBarPosition, direction));
|
: getTransformPropValue(getTransformByIndex(activeIndex, tabBarPosition, direction));
|
||||||
style = animatedStyle;
|
style = {
|
||||||
|
...this.$attrs.style,
|
||||||
|
...animatedStyle,
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
style = {
|
style = {
|
||||||
|
...this.$attrs.style,
|
||||||
display: 'none',
|
display: 'none',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue