feat: 🎨 解决关于 page 是否存在判断不合理的问题

Variable 'page' is null checked here, but its property is accessed without null check prior at line 160 .
This commit is contained in:
FairyEver 2020-06-08 15:02:41 +08:00
parent b1ea3e81a6
commit 7062d0622e
1 changed files with 4 additions and 2 deletions

View File

@ -157,8 +157,10 @@ export default {
handleClick (tab, event) {
// tag
const page = this.opened.find(page => page.fullPath === tab.name)
if (page) {
const { name, params, query } = page
if (page) this.$router.push({ name, params, query })
this.$router.push({ name, params, query })
}
},
/**
* @description 点击 tab 上的删除按钮触发这里