From 7062d0622ea74bea1397e24ba6b318b1a4a2dbcc Mon Sep 17 00:00:00 2001 From: FairyEver <1711467488@qq.com> Date: Mon, 8 Jun 2020 15:02:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20:art:=20=E8=A7=A3=E5=86=B3=E5=85=B3?= =?UTF-8?q?=E4=BA=8E=20page=20=E6=98=AF=E5=90=A6=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E4=B8=8D=E5=90=88=E7=90=86=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Variable 'page' is null checked here, but its property is accessed without null check prior at line 160 . --- src/layout/header-aside/components/tabs/index.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/layout/header-aside/components/tabs/index.vue b/src/layout/header-aside/components/tabs/index.vue index 830e54da..d83e4f43 100644 --- a/src/layout/header-aside/components/tabs/index.vue +++ b/src/layout/header-aside/components/tabs/index.vue @@ -157,8 +157,10 @@ export default { handleClick (tab, event) { // 找到点击的页面在 tag 列表里是哪个 const page = this.opened.find(page => page.fullPath === tab.name) - const { name, params, query } = page - if (page) this.$router.push({ name, params, query }) + if (page) { + const { name, params, query } = page + this.$router.push({ name, params, query }) + } }, /** * @description 点击 tab 上的删除按钮触发这里