This repository was archived by the owner on Oct 27, 2021. It is now read-only.
Commit 2da5b47 1 parent a876640 commit 2da5b47 Copy full SHA for 2da5b47
File tree 2 files changed +12
-3
lines changed
packages/taro-ui-vue/src/components/indexes
2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ export default {
27
27
} ,
28
28
isVibrate : {
29
29
type : Boolean ,
30
- default : true ,
30
+ default : false ,
31
31
} ,
32
32
isShowToast : {
33
33
type : Boolean ,
@@ -190,7 +190,7 @@ export default {
190
190
Taro . vibrateShort ( )
191
191
}
192
192
} ,
193
- initData ( ) {
193
+ getItemHeight ( ) {
194
194
delayQuerySelector ( this , '.at-indexes__menu' ) . then ( ( rect ) => {
195
195
const arr = [ ...rect , { top : 0 , height : 0 } ]
196
196
const len = this . list . length
@@ -199,6 +199,15 @@ export default {
199
199
this . itemHeight = Math . floor ( this . menuHeight / ( len + 1 ) )
200
200
} )
201
201
} ,
202
+ initData ( ) {
203
+ if ( this . isWeb ) {
204
+ this . getItemHeight ( )
205
+ } else {
206
+ setTimeout ( ( ) => {
207
+ this . getItemHeight ( )
208
+ } , 100 )
209
+ }
210
+ } ,
202
211
handleScroll ( e ) {
203
212
if ( e && e . detail ) {
204
213
this . setState ( {
Original file line number Diff line number Diff line change 29
29
<scroll-view
30
30
:id =" listId"
31
31
class =" at-indexes__body"
32
- scroll-y
32
+ : scroll-y= " true "
33
33
:scroll-with-animation =" animation"
34
34
:scroll-top =" isWEB ? state._scrollTop : undefined"
35
35
:scroll-into-view =" !isWEB ? state._scrollIntoView : ''"
You can’t perform that action at this time.
0 commit comments