From be887de7b6938b06601245f9ea1449772c4b6ebc Mon Sep 17 00:00:00 2001 From: Howie Date: Wed, 27 May 2020 20:10:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=B3=E9=97=AD=E6=9C=80=E5=90=8E?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E6=A0=87=E7=AD=BE=E9=A1=B5=E6=97=B6=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 通过 v-for 生成标签页列表,不用 ViewUI 自带关闭,而是手动关闭最后一个标签页时,出现 TypeError: Cannot read property 'disabled' of undefined 异常。 --- src/components/tabs/tabs.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/tabs/tabs.vue b/src/components/tabs/tabs.vue index c3b172f1..1c2367de 100644 --- a/src/components/tabs/tabs.vue +++ b/src/components/tabs/tabs.vue @@ -292,7 +292,7 @@ setTimeout(() => this.transitioning = false, transitionTime); const nav = this.navList[index]; - if (nav.disabled) return; + if (!nav || nav.disabled) return; this.activeKey = nav.name; this.$emit('input', nav.name); this.$emit('on-click', nav.name);