提升性能 修复前端tab页面bug 增加ws插件
This commit is contained in:
@@ -74,6 +74,9 @@ export default {
|
||||
}
|
||||
},
|
||||
$route(to, now) {
|
||||
if (to.name === 'Login') {
|
||||
return
|
||||
}
|
||||
this.historys = this.historys.filter(item => !item.meta.closeTab)
|
||||
this.setTab(to)
|
||||
sessionStorage.setItem('historys', JSON.stringify(this.historys))
|
||||
@@ -84,6 +87,14 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 全局监听 关闭当前页面函数
|
||||
emitter.on('closeThisPage', () => {
|
||||
this.removeTab(this.name(this.$route))
|
||||
})
|
||||
// 全局监听 关闭所有页面函数
|
||||
emitter.on('closeAllPage', () => {
|
||||
this.closeAll()
|
||||
})
|
||||
emitter.on('mobile', isMobile => {
|
||||
this.isMobile = isMobile
|
||||
})
|
||||
@@ -109,12 +120,6 @@ export default {
|
||||
}
|
||||
this.setTab(this.$route)
|
||||
},
|
||||
mounted() {
|
||||
// 全局监听 关闭当前页面函数
|
||||
emitter.on('closeThisPage', () => {
|
||||
this.removeTab(this.name(this.$route))
|
||||
})
|
||||
},
|
||||
beforeDestroy() {
|
||||
emitter.off('collapse')
|
||||
emitter.off('mobile')
|
||||
|
||||
@@ -212,6 +212,7 @@ export default {
|
||||
authorityId: id
|
||||
})
|
||||
if (res.code === 0) {
|
||||
emitter.emit('closeAllPage')
|
||||
window.location.reload()
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user