Insteadof mount all tabs & hiding,use :is to mount
This commit is contained in:
@@ -11,9 +11,7 @@ import VirtualLotteryPage from "@/components/VirtualLotteryPage";
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
Tabs,
|
Tabs
|
||||||
GeneratePage,
|
|
||||||
VirtualLotteryPage
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user