refactor: pinia整合优化重构

This commit is contained in:
郝先瑞
2022-03-11 00:07:34 +08:00
parent 7bd9d70433
commit 4ae629ab65
26 changed files with 675 additions and 563 deletions

View File

@@ -1,9 +1,9 @@
<template>
<section class="app-main">
<router-view v-slot="{ Component ,route}">
<router-view v-slot="{ Component, route }">
<transition name="router-fade" mode="out-in">
<keep-alive :include="cachedViews">
<component :is="Component" :key="route.path"/>
<component :is="Component" :key="route.path" />
</keep-alive>
</transition>
</router-view>
@@ -12,11 +12,12 @@
<script setup lang="ts">
import {computed} from "vue";
import {useTagsViewStoreHook} from '@/store/modules/tagsView'
import { computed } from "vue";
import useStore from "@/store";
const cachedViews = computed(() => useTagsViewStoreHook().cachedViews);
const { tagsView } = useStore();
const cachedViews = computed(() => tagsView.cachedViews);
</script>
<style lang="scss" scoped>
@@ -28,7 +29,7 @@ const cachedViews = computed(() => useTagsViewStoreHook().cachedViews);
overflow: hidden;
}
.fixed-header+.app-main {
.fixed-header + .app-main {
padding-top: 50px;
}
@@ -38,7 +39,7 @@ const cachedViews = computed(() => useTagsViewStoreHook().cachedViews);
min-height: calc(100vh - 84px);
}
.fixed-header+.app-main {
.fixed-header + .app-main {
padding-top: 84px;
}
}