标签
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<section class="app-main">
|
<section class="app-main">
|
||||||
<transition name="fade-transform" mode="out-in">
|
<transition name="fade-transform" mode="out-in">
|
||||||
<router-view :key="key" />
|
<keep-alive :include="cachedViews">
|
||||||
|
<router-view :key="key" />
|
||||||
|
</keep-alive>
|
||||||
</transition>
|
</transition>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
@@ -10,6 +12,9 @@
|
|||||||
export default {
|
export default {
|
||||||
name: 'AppMain',
|
name: 'AppMain',
|
||||||
computed: {
|
computed: {
|
||||||
|
cachedViews() {
|
||||||
|
return this.$store.state.tagsView.cachedViews
|
||||||
|
},
|
||||||
key() {
|
key() {
|
||||||
return this.$route.path
|
return this.$route.path
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
export { default as Navbar } from './Navbar'
|
export { default as Navbar } from './Navbar'
|
||||||
export { default as Sidebar } from './Sidebar'
|
export { default as Sidebar } from './Sidebar'
|
||||||
|
export { default as TagsView } from './TagsView'
|
||||||
export { default as AppMain } from './AppMain'
|
export { default as AppMain } from './AppMain'
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
<div class="main-container">
|
<div class="main-container">
|
||||||
<div :class="{'fixed-header':fixedHeader}">
|
<div :class="{'fixed-header':fixedHeader}">
|
||||||
<navbar />
|
<navbar />
|
||||||
|
<tags-view />
|
||||||
</div>
|
</div>
|
||||||
<app-main />
|
<app-main />
|
||||||
</div>
|
</div>
|
||||||
@@ -12,7 +13,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Navbar, Sidebar, AppMain } from './components'
|
import { Navbar, Sidebar, AppMain, TagsView } from './components'
|
||||||
import ResizeMixin from './mixin/ResizeHandler'
|
import ResizeMixin from './mixin/ResizeHandler'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -20,7 +21,8 @@ export default {
|
|||||||
components: {
|
components: {
|
||||||
Navbar,
|
Navbar,
|
||||||
Sidebar,
|
Sidebar,
|
||||||
AppMain
|
AppMain,
|
||||||
|
TagsView
|
||||||
},
|
},
|
||||||
mixins: [ResizeMixin],
|
mixins: [ResizeMixin],
|
||||||
computed: {
|
computed: {
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ export const constantRoutes = [
|
|||||||
path: 'dashboard',
|
path: 'dashboard',
|
||||||
name: 'Dashboard',
|
name: 'Dashboard',
|
||||||
component: () => import('@/views/dashboard/index'),
|
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,
|
device: state => state.app.device,
|
||||||
token: state => state.user.token,
|
token: state => state.user.token,
|
||||||
avatar: state => state.user.avatar,
|
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
|
export default getters
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ import getters from './getters'
|
|||||||
import app from './modules/app'
|
import app from './modules/app'
|
||||||
import settings from './modules/settings'
|
import settings from './modules/settings'
|
||||||
import user from './modules/user'
|
import user from './modules/user'
|
||||||
|
import permission from './modules/permission'
|
||||||
|
import tagsView from './modules/tagsView'
|
||||||
|
|
||||||
|
|
||||||
Vue.use(Vuex)
|
Vue.use(Vuex)
|
||||||
|
|
||||||
@@ -11,7 +14,9 @@ const store = new Vuex.Store({
|
|||||||
modules: {
|
modules: {
|
||||||
app,
|
app,
|
||||||
settings,
|
settings,
|
||||||
user
|
user,
|
||||||
|
permission,
|
||||||
|
tagsView
|
||||||
},
|
},
|
||||||
getters
|
getters
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user