From 56ecd55e12aded74209cf971aafd3285848c3797 Mon Sep 17 00:00:00 2001 From: nemo-shen Date: Sun, 26 Sep 2021 15:05:55 +0800 Subject: [PATCH] fix(Tab): fix init position incorrect (#4521) * fix(Tab): fix init position incorrect * style(Tab): prettier --- packages/tabs/index.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/tabs/index.ts b/packages/tabs/index.ts index 3f932388..54215951 100644 --- a/packages/tabs/index.ts +++ b/packages/tabs/index.ts @@ -49,10 +49,6 @@ VantComponent({ type: null, value: 0, observer(name) { - if (!this.skipInit) { - this.skipInit = true; - } - if (name !== this.getCurrentName()) { this.setCurrentIndexByName(name); } @@ -110,10 +106,8 @@ VantComponent({ container: () => this.createSelectorQuery().select('.van-tabs'), }); - if (!this.skipInit) { - this.resize(); - this.scrollIntoView(); - } + this.resize(); + this.scrollIntoView(); }); },