bug: fix the problem that page content become blank when modifying the code; 🐛 #141

修复:修改代码时页面内容变为空白的问题;
master
chenghongxing 4 years ago
parent ec2c70d181
commit e841ac77fd
  1. 2
      src/components/cache/AKeepAlive.js
  2. 3
      src/layouts/tabs/TabsView.vue

@ -127,7 +127,7 @@ export default {
// same constructor may get registered as different local components // same constructor may get registered as different local components
// so cid alone is not enough (#3269) // so cid alone is not enough (#3269)
? componentOptions.Ctor.cid + (componentOptions.tag ? `::${componentOptions.tag}` : '') ? componentOptions.Ctor.cid + (componentOptions.tag ? `::${componentOptions.tag}` : '')
: vnode.key : vnode.key + componentOptions.Ctor.cid
if (cache[key]) { if (cache[key]) {
vnode.componentInstance = cache[key].componentInstance vnode.componentInstance = cache[key].componentInstance
// make current key freshest // make current key freshest

@ -261,7 +261,8 @@ export default {
const page = this.pageList.find(item => item.fullPath === route.fullPath) const page = this.pageList.find(item => item.fullPath === route.fullPath)
page.unclose = route.meta && route.meta.page && (route.meta.page.closable === false) page.unclose = route.meta && route.meta.page && (route.meta.page.closable === false)
if (!page._init_) { if (!page._init_) {
page.cachedKey = this.$refs.tabContent.$vnode.key const vnode = this.$refs.tabContent.$vnode
page.cachedKey = vnode.key + vnode.componentOptions.Ctor.cid
page._init_ = true page._init_ = true
} }
}, },

Loading…
Cancel
Save