From 5ebc51e7748cc45c89d4423c4d2d9feb93ff05c1 Mon Sep 17 00:00:00 2001 From: neverland Date: Mon, 20 Apr 2020 19:46:26 +0800 Subject: [PATCH] fix(Tab): fail to init in some cases (#6101) --- src/tab/index.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tab/index.js b/src/tab/index.js index 807fcced3..75489232e 100644 --- a/src/tab/index.js +++ b/src/tab/index.js @@ -30,16 +30,16 @@ export default createComponent({ }, isActive() { - return this.computedName === this.parent.currentName; + const active = this.computedName === this.parent.currentName; + + if (active) { + this.inited = true; + } + return active; }, }, watch: { - // eslint-disable-next-line object-shorthand - 'parent.currentIndex'() { - this.inited = this.inited || this.isActive; - }, - title() { this.parent.setLine(); },