Home.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <div class="about">
  3. <el-config-provider :locale="zhCn">
  4. <v-header />
  5. <v-sidebar />
  6. <div class="content-box" :class="{ 'content-collapse': collapse }">
  7. <v-tags></v-tags>
  8. <div class="content">
  9. <!-- <router-view /> -->
  10. <router-view v-slot="{ Component }">
  11. <transition name="move" mode="out-in">
  12. <keep-alive :include="tagsList">
  13. <component :is="Component" />
  14. </keep-alive>
  15. </transition>
  16. </router-view>
  17. </div>
  18. </div>
  19. </el-config-provider>
  20. </div>
  21. </template>
  22. <script setup>
  23. import { ElConfigProvider } from "element-plus"
  24. import zhCn from "element-plus/lib/locale/lang/zh-cn"
  25. import { computed ,onBeforeMount } from 'vue'
  26. import { useStore } from 'vuex'
  27. import vHeader from '../components/Header.vue'
  28. import vSidebar from '../components/Sidebar.vue'
  29. import vTags from '../components/Tags.vue'
  30. const store = useStore()
  31. const tagsList = computed(() => store.state.tagsList.map(item => item.name))
  32. const collapse = computed(() => store.state.collapse)
  33. // import { fetchStationList,fetchStationListAll } from "/@/api/api.js";
  34. onBeforeMount(async () => {
  35. // await getStationList();
  36. // await getStationListAll();
  37. });
  38. //get 场站
  39. // const getStationList = async () => {
  40. // const res = await fetchStationList();
  41. // store.dispatch("actionsStationList", res);
  42. // };
  43. // const getStationListAll = async () => {
  44. // const res = await fetchStationListAll();
  45. // store.dispatch("actionsStationListAll", res);
  46. // };
  47. </script>