From bf564695529e6ce82dce88385d5c4e7788371b0f Mon Sep 17 00:00:00 2001 From: johnsonwong666 <1067100250@qq.com> Date: Fri, 26 May 2023 14:42:24 +0800 Subject: [PATCH] fix(tab): fix async tab insert --- 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 6968995bf..85acfb334 100644 --- a/packages/tabs/index.ts +++ b/packages/tabs/index.ts @@ -131,7 +131,7 @@ VantComponent({ scrollable: this.children.length > data.swipeThreshold || !data.ellipsis, }); - + this.resize(); this.setCurrentIndexByName(data.active || this.getCurrentName()); }, @@ -196,13 +196,7 @@ VantComponent({ }); }); - if (currentIndex === data.currentIndex) { - if (!data.inited) { - this.resize(); - } - return; - } - + if (currentIndex === data.currentIndex) return; const shouldEmitChange = data.currentIndex !== null; this.setData({ currentIndex });