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

View File

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