标签
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -51,7 +51,7 @@ export const constantRoutes = [
|
||||
path: 'dashboard',
|
||||
name: 'Dashboard',
|
||||
component: () => import('@/views/dashboard/index'),
|
||||
meta: { title: '首页', icon: 'dashboard' }
|
||||
meta: { title: '首页', icon: 'dashboard', affix: true }
|
||||
}]
|
||||
},
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ const getters = {
|
||||
device: state => state.app.device,
|
||||
token: state => state.user.token,
|
||||
avatar: state => state.user.avatar,
|
||||
name: state => state.user.name
|
||||
name: state => state.user.name,
|
||||
permission_routes: state => state.permission.routes,
|
||||
cachedViews: state => state.tagsView.cachedViews,
|
||||
visitedViews: state => state.tagsView.visitedViews
|
||||
}
|
||||
export default getters
|
||||
|
||||
@@ -4,6 +4,9 @@ import getters from './getters'
|
||||
import app from './modules/app'
|
||||
import settings from './modules/settings'
|
||||
import user from './modules/user'
|
||||
import permission from './modules/permission'
|
||||
import tagsView from './modules/tagsView'
|
||||
|
||||
|
||||
Vue.use(Vuex)
|
||||
|
||||
@@ -11,7 +14,9 @@ const store = new Vuex.Store({
|
||||
modules: {
|
||||
app,
|
||||
settings,
|
||||
user
|
||||
user,
|
||||
permission,
|
||||
tagsView
|
||||
},
|
||||
getters
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user