From ba0e13afbc0e14b376fdd8e6b7a003a0459c245a Mon Sep 17 00:00:00 2001 From: liyang <1711467488@qq.com> Date: Sun, 15 Jul 2018 23:47:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E7=9A=84=E7=BC=93=E5=AD=98=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: a29298a6255c4ab27dae4f6cef1ad95af8edbb63 [formerly a29298a6255c4ab27dae4f6cef1ad95af8edbb63 [formerly a29298a6255c4ab27dae4f6cef1ad95af8edbb63 [formerly a29298a6255c4ab27dae4f6cef1ad95af8edbb63 [formerly 633bc86c464db9626dc7c685527d3b0141aaabcd [formerly a219fab24d89a2dbc45f44c0c5f00d8246fb5dee]]]]] Former-commit-id: b72ea88277cc8a9f477270b7911919cd65f7d6cf Former-commit-id: e9aa72de44d189ce01f5898d55f8846adf1a4a12 Former-commit-id: 193b9799bf048d40e9c80ae756e0c70a9e976688 [formerly f250fd937521c1a26908e06534aaeeef53a5c490] Former-commit-id: abf976b6aca174612973f137e9b19f490e0dd49a Former-commit-id: 6d5a92cc18402b30bea95166232bb3d1172dba8d Former-commit-id: 7b93dca709c2506d327e4a6da6989b48d1f6daab Former-commit-id: da3f5e206587c7e98e3e5fc36f775e08e032f434 Former-commit-id: 6e36d769ce06dfbeacbd2b36c02d107e13354a8b --- src/components/core/d2-layout-main/index.vue | 27 ++++++++++---------- src/pages/demo/playground/page-cache/on.vue | 1 + src/router/routes.js.REMOVED.git-id | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/components/core/d2-layout-main/index.vue b/src/components/core/d2-layout-main/index.vue index 60025cb2..10b922cd 100644 --- a/src/components/core/d2-layout-main/index.vue +++ b/src/components/core/d2-layout-main/index.vue @@ -39,13 +39,10 @@
- - + + - - -
@@ -77,25 +74,27 @@ export default { }, computed: { ...mapState({ - isGrayMode: state => state.d2admin.isGrayMode + isGrayMode: state => state.d2admin.isGrayMode, + pageOpenedList: state => state.d2admin.pageOpenedList }), ...mapGetters([ 'themeActiveSetting' ]), + /** + * @description 返回现在需要缓存的页面 name + */ + keepAliveList () { + return this.pageOpenedList.filter(item => !(item.meta && item.meta.notCache)).map(e => e.name) + }, + /** + * @description 最外层容器的背景图片样式 + */ styleLayoutMainGroup () { return { ...this.themeActiveSetting.backgroundImage ? { backgroundImage: `url('${this.$assetsPublicPath}${this.themeActiveSetting.backgroundImage}')` } : {} } - }, - alive () { - if (this.$route.meta) { - if (this.$route.meta.alive) { - return true - } - } - return false } } } diff --git a/src/pages/demo/playground/page-cache/on.vue b/src/pages/demo/playground/page-cache/on.vue index 8d5ed49c..4c9bc566 100644 --- a/src/pages/demo/playground/page-cache/on.vue +++ b/src/pages/demo/playground/page-cache/on.vue @@ -8,6 +8,7 @@