2019-08-14 09:48:44 +00:00
|
|
|
/* eslint no-unused-vars: ["error", { "args": "none" }] */
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'WootTabs',
|
|
|
|
props: {
|
|
|
|
index: {
|
|
|
|
type: Number,
|
|
|
|
default: 0,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
render(h) {
|
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>
|
|
|
|
);
|
|
|
|
},
|
|
|
|
};
|