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 { export default {
components: { components: {
Tabs, Tabs
GeneratePage,
VirtualLotteryPage
}, },
data() { data() {
return { return {

View File

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