Skip to content
This repository was archived by the owner on Oct 27, 2021. It is now read-only.

Commit 2da5b47

Browse files
committed
fix: indexes in weapp
1 parent a876640 commit 2da5b47

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

packages/taro-ui-vue/src/components/indexes/index.ts

+11-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default {
2727
},
2828
isVibrate: {
2929
type: Boolean,
30-
default: true,
30+
default: false,
3131
},
3232
isShowToast: {
3333
type: Boolean,
@@ -190,7 +190,7 @@ export default {
190190
Taro.vibrateShort()
191191
}
192192
},
193-
initData() {
193+
getItemHeight () {
194194
delayQuerySelector(this, '.at-indexes__menu').then((rect) => {
195195
const arr = [...rect, { top: 0, height: 0 }]
196196
const len = this.list.length
@@ -199,6 +199,15 @@ export default {
199199
this.itemHeight = Math.floor(this.menuHeight / (len + 1))
200200
})
201201
},
202+
initData() {
203+
if (this.isWeb) {
204+
this.getItemHeight()
205+
} else {
206+
setTimeout(() => {
207+
this.getItemHeight()
208+
}, 100)
209+
}
210+
},
202211
handleScroll(e) {
203212
if (e && e.detail) {
204213
this.setState({

packages/taro-ui-vue/src/components/indexes/index.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<scroll-view
3030
:id="listId"
3131
class="at-indexes__body"
32-
scroll-y
32+
:scroll-y="true"
3333
:scroll-with-animation="animation"
3434
:scroll-top="isWEB ? state._scrollTop : undefined"
3535
:scroll-into-view="!isWEB ? state._scrollIntoView : ''"

0 commit comments

Comments
 (0)