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

Commit

Permalink
fix: indexes in weapp
Browse files Browse the repository at this point in the history
psaren committed Sep 13, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent a876640 commit cee38fa
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion packages/taro-ui-vue/src/components/indexes/index.ts
Original file line number Diff line number Diff line change
@@ -190,7 +190,7 @@ export default {
Taro.vibrateShort()
}
},
initData() {
getItemHeight () {
delayQuerySelector(this, '.at-indexes__menu').then((rect) => {
const arr = [...rect, { top: 0, height: 0 }]
const len = this.list.length
@@ -199,6 +199,15 @@ export default {
this.itemHeight = Math.floor(this.menuHeight / (len + 1))
})
},
initData() {
if (this.isWeb) {
this.getItemHeight()
} else {
setTimeout(() => {
this.getItemHeight()
}, 100)
}
},
handleScroll(e) {
if (e && e.detail) {
this.setState({
2 changes: 1 addition & 1 deletion packages/taro-ui-vue/src/components/indexes/index.vue
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@
<scroll-view
:id="listId"
class="at-indexes__body"
scroll-y
:scroll-y="true"
:scroll-with-animation="animation"
:scroll-top="isWEB ? state._scrollTop : undefined"
:scroll-into-view="!isWEB ? state._scrollIntoView : ''"

0 comments on commit cee38fa

Please sign in to comment.