mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
fix(Tabs): fix some error when component init (#2133)
This commit is contained in:
parent
716c76e900
commit
a14ad6e384
@ -96,7 +96,7 @@ VantComponent({
|
|||||||
trackStyle: '',
|
trackStyle: '',
|
||||||
wrapStyle: '',
|
wrapStyle: '',
|
||||||
position: '',
|
position: '',
|
||||||
currentIndex: null,
|
currentIndex: 0,
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
@ -239,7 +239,7 @@ VantComponent({
|
|||||||
|
|
||||||
setActiveTab() {
|
setActiveTab() {
|
||||||
if (!isDef(this.currentName)) {
|
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) => {
|
this.children.forEach((item: WechatMiniprogram.Component.TrivialInstance, index: number) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user