feat: update vc-tabs to 9.6.1
parent
0593665d7c
commit
8713210000
|
@ -22,12 +22,13 @@ export default {
|
||||||
render() {
|
render() {
|
||||||
const props = { ...this.$props };
|
const props = { ...this.$props };
|
||||||
const listeners = this.$listeners;
|
const listeners = this.$listeners;
|
||||||
|
const { renderTabBarNode } = this.scopedSlots;
|
||||||
return (
|
return (
|
||||||
<SaveRef
|
<SaveRef
|
||||||
children={(saveRef, getRef) => (
|
children={(saveRef, getRef) => (
|
||||||
<TabBarRootNode saveRef={saveRef} {...{ props, on: listeners }}>
|
<TabBarRootNode saveRef={saveRef} {...{ props, on: listeners }}>
|
||||||
<ScrollableTabBarNode saveRef={saveRef} getRef={getRef} {...{ props, on: listeners }}>
|
<ScrollableTabBarNode saveRef={saveRef} getRef={getRef} {...{ props, on: listeners }}>
|
||||||
<TabBarTabsNode saveRef={saveRef} {...{ props, on: listeners }} />
|
<TabBarTabsNode saveRef={saveRef} {...{ props: {...props, renderTabBarNode}, on: listeners }} />
|
||||||
<InkTabBarNode saveRef={saveRef} getRef={getRef} {...{ props, on: listeners }} />
|
<InkTabBarNode saveRef={saveRef} getRef={getRef} {...{ props, on: listeners }} />
|
||||||
</ScrollableTabBarNode>
|
</ScrollableTabBarNode>
|
||||||
</TabBarRootNode>
|
</TabBarRootNode>
|
||||||
|
|
|
@ -10,13 +10,13 @@ export default {
|
||||||
name: 'ScrollableTabBarNode',
|
name: 'ScrollableTabBarNode',
|
||||||
mixins: [BaseMixin],
|
mixins: [BaseMixin],
|
||||||
props: {
|
props: {
|
||||||
saveRef: PropTypes.func.def(() => {}),
|
activeKey: PropTypes.any,
|
||||||
getRef: PropTypes.func.def(() => {}),
|
getRef: PropTypes.func.def(() => {}),
|
||||||
|
saveRef: PropTypes.func.def(() => {}),
|
||||||
tabBarPosition: PropTypes.oneOf(['left', 'right', 'top', 'bottom']).def('left'),
|
tabBarPosition: PropTypes.oneOf(['left', 'right', 'top', 'bottom']).def('left'),
|
||||||
prefixCls: PropTypes.string.def(''),
|
prefixCls: PropTypes.string.def(''),
|
||||||
scrollAnimated: PropTypes.bool.def(true),
|
scrollAnimated: PropTypes.bool.def(true),
|
||||||
navWrapper: PropTypes.func.def(arg => arg),
|
navWrapper: PropTypes.func.def(arg => arg),
|
||||||
activeKey: PropTypes.any,
|
|
||||||
prevIcon: PropTypes.any,
|
prevIcon: PropTypes.any,
|
||||||
nextIcon: PropTypes.any,
|
nextIcon: PropTypes.any,
|
||||||
},
|
},
|
||||||
|
|
|
@ -15,6 +15,7 @@ export default {
|
||||||
onTabClick: PropTypes.func,
|
onTabClick: PropTypes.func,
|
||||||
saveRef: PropTypes.func.def(noop),
|
saveRef: PropTypes.func.def(noop),
|
||||||
getRef: PropTypes.func.def(noop),
|
getRef: PropTypes.func.def(noop),
|
||||||
|
renderTabBarNode: PropTypes.func,
|
||||||
tabBarPosition: PropTypes.string,
|
tabBarPosition: PropTypes.string,
|
||||||
},
|
},
|
||||||
render() {
|
render() {
|
||||||
|
@ -27,7 +28,7 @@ export default {
|
||||||
tabBarPosition,
|
tabBarPosition,
|
||||||
} = this.$props;
|
} = this.$props;
|
||||||
const rst = [];
|
const rst = [];
|
||||||
|
const renderTabBarNode = this.renderTabBarNode || this.$scopedSlots.renderTabBarNode;
|
||||||
children.forEach((child, index) => {
|
children.forEach((child, index) => {
|
||||||
if (!child) {
|
if (!child) {
|
||||||
return;
|
return;
|
||||||
|
@ -59,7 +60,7 @@ export default {
|
||||||
[isVertical(tabBarPosition) ? 'marginBottom' : 'marginRight']: gutter,
|
[isVertical(tabBarPosition) ? 'marginBottom' : 'marginRight']: gutter,
|
||||||
};
|
};
|
||||||
warning(tab !== undefined, 'There must be `tab` property or slot on children of Tabs.');
|
warning(tab !== undefined, 'There must be `tab` property or slot on children of Tabs.');
|
||||||
rst.push(
|
let node = (
|
||||||
<div
|
<div
|
||||||
role="tab"
|
role="tab"
|
||||||
aria-disabled={disabled ? 'true' : 'false'}
|
aria-disabled={disabled ? 'true' : 'false'}
|
||||||
|
@ -71,8 +72,13 @@ export default {
|
||||||
{...{ directives: directives }}
|
{...{ directives: directives }}
|
||||||
>
|
>
|
||||||
{tab}
|
{tab}
|
||||||
</div>,
|
</div>
|
||||||
);
|
);
|
||||||
|
if (renderTabBarNode) {
|
||||||
|
node = renderTabBarNode(node);
|
||||||
|
}
|
||||||
|
|
||||||
|
rst.push(node);
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// based on rc-tabs 9.5.8
|
// based on rc-tabs 9.6.1
|
||||||
import ref from 'vue-ref';
|
import ref from 'vue-ref';
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import Tabs from './Tabs';
|
import Tabs from './Tabs';
|
||||||
|
|
Loading…
Reference in New Issue