新的缓存逻辑
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
This commit is contained in:
@@ -39,13 +39,10 @@
|
||||
</div>
|
||||
<div class="d2-theme-container-main-body">
|
||||
<transition name="fade-transverse">
|
||||
<keep-alive>
|
||||
<router-view v-if="alive"/>
|
||||
<keep-alive :include="keepAliveList">
|
||||
<router-view/>
|
||||
</keep-alive>
|
||||
</transition>
|
||||
<transition name="fade-transverse">
|
||||
<router-view v-if="!alive"/>
|
||||
</transition>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user