diff --git a/src/components/ThemeSetting/index.vue b/src/components/ThemeSetting/index.vue index 89b00edf..59d1d321 100644 --- a/src/components/ThemeSetting/index.vue +++ b/src/components/ThemeSetting/index.vue @@ -41,8 +41,7 @@ 开启 关闭 - - + diff --git a/src/layout/empty.vue b/src/layout/empty.vue new file mode 100644 index 00000000..a44f915b --- /dev/null +++ b/src/layout/empty.vue @@ -0,0 +1,16 @@ + + + diff --git a/src/layout/index.vue b/src/layout/index.vue index 88b98f3a..4fbeed50 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -88,7 +88,7 @@
- +
@@ -106,6 +106,7 @@ import variables from '@/assets/styles/resources/variables.scss' export default { + inject: ['reload'], name: 'Layout', data() { return { @@ -144,8 +145,16 @@ export default { }, mounted() { this.$hotkeys('alt+s', e => { - e.preventDefault() - this.$store.commit('global/toggleSearch') + if (this.$store.state.global.enableNavSearch) { + e.preventDefault() + this.$store.commit('global/toggleSearch') + } + }) + this.$hotkeys('f5', e => { + if (this.$store.state.global.enablePageReload) { + e.preventDefault() + this.reload(2) + } }) window.addEventListener('scroll', this.onScroll) }, diff --git a/src/layout/keepAlive.vue b/src/layout/keepAlive.vue deleted file mode 100644 index e4b27e6e..00000000 --- a/src/layout/keepAlive.vue +++ /dev/null @@ -1,37 +0,0 @@ - - - - - diff --git a/src/router/index.js b/src/router/index.js index 6b0a9835..4fce2c44 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -7,7 +7,7 @@ import 'nprogress/nprogress.css' // progress bar style Vue.use(Router) import Layout from '@/layout' -import KeepAliveLayout from '@/layout/keepAlive' +import EmptyLayout from '@/layout/empty' const constantRoutes = [ { @@ -33,7 +33,7 @@ const constantRoutes = [ }, { path: 'personal', - component: KeepAliveLayout, + component: EmptyLayout, redirect: '/personal/setting', meta: { title: '个人中心', diff --git a/src/router/modules/breadcrumb.example.js b/src/router/modules/breadcrumb.example.js index 1d75be4f..de44e80a 100644 --- a/src/router/modules/breadcrumb.example.js +++ b/src/router/modules/breadcrumb.example.js @@ -1,5 +1,5 @@ import Layout from '@/layout' -import KeepAliveLayout from '@/layout/keepAlive' +import EmptyLayout from '@/layout/empty' export default { path: '/breadcrumb_example', @@ -32,7 +32,7 @@ export default { { path: 'list2', name: 'breadcrumbExampleList2', - component: KeepAliveLayout, + component: EmptyLayout, redirect: '/breadcrumb_example/list2', meta: { title: '列表2(层级模式)' diff --git a/src/router/modules/keep.alive.example.js b/src/router/modules/keep.alive.example.js index ffa687bc..289d6b7d 100644 --- a/src/router/modules/keep.alive.example.js +++ b/src/router/modules/keep.alive.example.js @@ -1,5 +1,5 @@ import Layout from '@/layout' -import KeepAliveLayout from '@/layout/keepAlive' +import EmptyLayout from '@/layout/empty' export default { path: '/keep_alive_example', @@ -33,7 +33,7 @@ export default { }, { path: 'detail2', - component: KeepAliveLayout, + component: EmptyLayout, redirect: '/keep_alive_example/detail2', meta: { title: '下级路由', @@ -51,7 +51,7 @@ export default { }, { path: 'detail3', - component: KeepAliveLayout, + component: EmptyLayout, redirect: '/keep_alive_example/detail2/detail3', meta: { title: '下下级路由', diff --git a/src/router/modules/multilevel.menu.example.js b/src/router/modules/multilevel.menu.example.js index ecca7b0a..64d88008 100644 --- a/src/router/modules/multilevel.menu.example.js +++ b/src/router/modules/multilevel.menu.example.js @@ -1,5 +1,5 @@ import Layout from '@/layout' -import KeepAliveLayout from '@/layout/keepAlive' +import EmptyLayout from '@/layout/empty' export default { path: '/multilevel_menu_example', @@ -22,7 +22,7 @@ export default { { path: 'level2', name: 'multilevelMenuExample2', - component: KeepAliveLayout, + component: EmptyLayout, redirect: '/multilevel_menu_example/level2/page', meta: { title: '导航2' @@ -39,7 +39,7 @@ export default { { path: 'level3', name: 'multilevelMenuExample2-2', - component: KeepAliveLayout, + component: EmptyLayout, redirect: '/multilevel_menu_example/level2/level3/page1', meta: { title: '导航2-2'