fix: 关闭最后一个标签页时报错

通过 v-for 生成标签页列表,不用 ViewUI 自带关闭,而是手动关闭最后一个标签页时,出现 TypeError: Cannot read property 'disabled' of undefined 异常。
This commit is contained in:
Howie 2020-05-27 20:10:36 +08:00 committed by GitHub
parent 8a994e63bf
commit be887de7b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);