feat(projects): 添加multiTab标签页

This commit is contained in:
Soybean
2021-09-17 08:31:49 +08:00
parent 789855a378
commit eec0b36f59
14 changed files with 130 additions and 37 deletions

View File

@ -1,7 +1,12 @@
<template>
<n-scrollbar ref="scrollbar" class="h-full" :x-scrollable="true" :content-class="fullPage ? 'h-full' : ''">
<div class="inline-block w-full" :class="[fullPage ? 'h-full' : 'min-h-100vh']">
<router-view />
<router-view v-slot="{ Component }">
<keep-alive v-if="keepAlive">
<component :is="Component" />
</keep-alive>
<component :is="Component" v-else />
</router-view>
</div>
</n-scrollbar>
</template>
@ -15,6 +20,9 @@ import { useScrollBehavior } from '@/hooks';
const route = useRoute();
const { scrollbar, resetScrollWatcher } = useScrollBehavior();
/** 缓存页面 */
const keepAlive = computed(() => Boolean(route.meta?.keepAlive));
/** 100%视高 */
const fullPage = computed(() => Boolean(route.meta?.fullPage));