Insteadof mount all tabs & hiding,use :is to mount

This commit is contained in:
2020-06-14 13:37:44 +02:00
committed by KevinMidboe
parent efb5dfcd3e
commit ab8fd9dd83
2 changed files with 2 additions and 12 deletions

View File

@@ -11,9 +11,7 @@ import VirtualLotteryPage from "@/components/VirtualLotteryPage";
export default {
components: {
Tabs,
GeneratePage,
VirtualLotteryPage
Tabs
},
data() {
return {

View File

@@ -10,12 +10,7 @@
>{{ tab.name }}</div>
</div>
<div class="tab-elements">
<component
v-for="(tab, index) in tabs"
:key="index"
:is="tab.component"
:class="chosenTab == index ? null : 'hide'"
/>
<component :is="tabs[chosenTab].component" />
</div>
</div>
</template>
@@ -54,9 +49,6 @@ export default {
h1 {
text-align: center;
}
.hide {
display: none;
}
.tab-container {
display: flex;