zhuguifei
2025-06-17 c1cc49dd93d38f51790558541d6835d1598ecccf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<script setup lang="ts">
import tabbar from "@/components/tabbar/index.vue";
import MenuBar from "@/components/menu-bar/index.vue";
import { useCachedViewStoreHook } from "@/store/modules/cached-view";
import { useDarkMode } from "@/composables/useToggleDarkMode";
import { computed } from "vue";
 
const cachedViews = computed(() => {
  return useCachedViewStoreHook().cachedViewList;
});
</script>
 
<template>
  <div class="app-wrapper">
    <van-config-provider :theme="useDarkMode() ? 'dark' : 'light'">
      <menu-bar />
      <div class="content-wrapper">
        <router-view v-slot="{ Component }">
          <keep-alive :include="cachedViews">
            <component :is="Component" />
          </keep-alive>
        </router-view>
      </div>
<!--      <tabbar />-->
    </van-config-provider>
  </div>
</template>
 
<style lang="less" scoped>
@import "@/styles/mixin.less";
 
.app-wrapper {
  width: 100vw;
  height: 100vh;
 
}
.content-wrapper {
  width: 100vw;
  height: calc(100vh - 85px);
}
</style>