diff --git a/example/pages/tab/index.wxml b/example/pages/tab/index.wxml index 0fe6f836..81d33a4e 100644 --- a/example/pages/tab/index.wxml +++ b/example/pages/tab/index.wxml @@ -13,7 +13,7 @@ - + child.getComputedName() === name ); - const defaultIndex = (children[0] || {}).index || 0; - this.setCurrentIndex(matched.length ? matched[0].index : defaultIndex); + + if (matched.length) { + this.setCurrentIndex(matched[0].index); + } }, setCurrentIndex(currentIndex) {