2019-08-14 09:48:44 +00:00
|
|
|
export default {
|
|
|
|
name: 'WootTabs',
|
|
|
|
props: {
|
|
|
|
index: {
|
|
|
|
type: Number,
|
|
|
|
default: 0,
|
|
|
|
},
|
|
|
|
},
|
2020-07-26 12:16:29 +00:00
|
|
|
render() {
|
2019-08-21 07:29:56 +00:00
|
|
|
const Tabs = this.$slots.default
|
|
|
|
.filter(
|
|
|
|
node =>
|
|
|
|
node.componentOptions &&
|
|
|
|
node.componentOptions.tag === 'woot-tabs-item'
|
|
|
|
)
|
|
|
|
.map((node, index) => {
|
|
|
|
const data = node.componentOptions.propsData;
|
|
|
|
data.index = index;
|
|
|
|
return node;
|
|
|
|
});
|
2019-08-14 09:48:44 +00:00
|
|
|
return (
|
2019-08-21 07:29:56 +00:00
|
|
|
<ul
|
|
|
|
class={{
|
|
|
|
tabs: true,
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{Tabs}
|
2019-08-14 09:48:44 +00:00
|
|
|
</ul>
|
|
|
|
);
|
|
|
|
},
|
|
|
|
};
|