From a14ad6e38479743187b6469e6055060916f3257b Mon Sep 17 00:00:00 2001 From: ShuaiKang Zhang Date: Thu, 10 Oct 2019 17:58:50 +0800 Subject: [PATCH] fix(Tabs): fix some error when component init (#2133) --- packages/tabs/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/tabs/index.ts b/packages/tabs/index.ts index 6c13e522..55c1817a 100644 --- a/packages/tabs/index.ts +++ b/packages/tabs/index.ts @@ -96,7 +96,7 @@ VantComponent({ trackStyle: '', wrapStyle: '', position: '', - currentIndex: null, + currentIndex: 0, }, watch: { @@ -239,7 +239,7 @@ VantComponent({ setActiveTab() { if (!isDef(this.currentName)) { - this.currentName = this.data.active || this.children[0].computedName; + this.currentName = this.data.active || (this.children[0] || {}).computedName; } this.children.forEach((item: WechatMiniprogram.Component.TrivialInstance, index: number) => {