admin管理员组文章数量:1356761
<mt-tabs
@new-item-active="setActiveItem"
:items="[
{
label: '1',
name: 'tab1'
},
{
label: '2',
name: 'tab2'
}
]"
>
<template #content>
<p>Tab Content Loaded!</p>
</template>
</mt-tabs>
1 and 2 are showing up but the content is not visible. Any ideas what I am doing wrong?
I changed template #content
to template #default
with no success.
<mt-tabs
@new-item-active="setActiveItem"
:items="[
{
label: '1',
name: 'tab1'
},
{
label: '2',
name: 'tab2'
}
]"
>
<template #content>
<p>Tab Content Loaded!</p>
</template>
</mt-tabs>
1 and 2 are showing up but the content is not visible. Any ideas what I am doing wrong?
I changed template #content
to template #default
with no success.
1 Answer
Reset to default 0The content slot <template #content>
is not supported anymore. You need to set the content manually outside the component <mt-tabs>.
You can use the @new-item-active
event to get the active item and set it to a variable. Then, use variables in your template:
<template>
<div>
<mt-tabs
:items="[
{ label: '1', name: 'tab1' },
{ label: '2', name: 'tab2' }
]"
@new-item-active="setActiveItem"
/>
<sw-tab1 v-if="currentActiveTab === 'tab1'" />
<sw-tab2 v-if="currentActiveTab === 'tab2'" />
</div>
</template>
<script>
export default {
data() {
return {
currentActiveTab: 'tab1',
};
},
methods: {
setActiveItem(item: string): void {
this.currentActiveTab = item;
},
},
};
</script>
本文标签: shopwareTab content not showing after updating swtabs with mttabsStack Overflow
版权声明:本文标题:shopware - Tab content not showing after updating sw-tabs with mt-tabs - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743974561a2570824.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论