提升性能 修复前端tab页面bug 增加ws插件

This commit is contained in:
蒋吉兆
2021-09-01 23:06:25 +08:00
parent e01bf225c4
commit f5171528d6
7 changed files with 97 additions and 101 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "gin-vue-admin",
"version": "0.1.0",
"version": "2.3.5 ",
"private": true,
"scripts": {
"serve": "node openDocument.js && vue-cli-service serve",
@@ -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')
+1
View File
@@ -212,6 +212,7 @@ export default {
authorityId: id
})
if (res.code === 0) {
emitter.emit('closeAllPage')
window.location.reload()
}
},