This commit is contained in:
spllzh
2025-08-10 17:42:54 +08:00
parent 4a312d67ac
commit 30b9316f17
6 changed files with 23 additions and 6 deletions

View File

@@ -1,7 +1,9 @@
<template>
<section class="app-main">
<transition name="fade-transform" mode="out-in">
<router-view :key="key" />
<keep-alive :include="cachedViews">
<router-view :key="key" />
</keep-alive>
</transition>
</section>
</template>
@@ -10,6 +12,9 @@
export default {
name: 'AppMain',
computed: {
cachedViews() {
return this.$store.state.tagsView.cachedViews
},
key() {
return this.$route.path
}

View File

@@ -1,3 +1,5 @@
export { default as Navbar } from './Navbar'
export { default as Sidebar } from './Sidebar'
export { default as TagsView } from './TagsView'
export { default as AppMain } from './AppMain'

View File

@@ -5,6 +5,7 @@
<div class="main-container">
<div :class="{'fixed-header':fixedHeader}">
<navbar />
<tags-view />
</div>
<app-main />
</div>
@@ -12,7 +13,7 @@
</template>
<script>
import { Navbar, Sidebar, AppMain } from './components'
import { Navbar, Sidebar, AppMain, TagsView } from './components'
import ResizeMixin from './mixin/ResizeHandler'
export default {
@@ -20,7 +21,8 @@ export default {
components: {
Navbar,
Sidebar,
AppMain
AppMain,
TagsView
},
mixins: [ResizeMixin],
computed: {