index.wxml
 
 
<scroll-view scroll-x style="width:100%;white-space:nowrap">
<view wx:for="{{30}}" style="display:inline-block; margin:10rpx;border:1rpx solid red" data->{{index}}</view>
</scroll-view>
<scroll-view scroll-y style='height:400rpx;' scroll-into-view="{{intoView}}" scroll-with-animation>
<view wx:for="{{30}}" >{{index}}</view>
</scroll-view>
 
 
 
index.js
 
 
 
 
 
const app = getApp()

Page({
data: {

},
scroll: function(e){
this.setData({
intoView: "view"+e.currentTarget.dataset.id
})
}
})

相关文章:

  • 2021-09-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-13
  • 2021-10-25
  • 2021-12-12
猜你喜欢
  • 2021-09-06
  • 2022-12-23
  • 2021-06-25
  • 2022-12-23
  • 2022-12-23
  • 2021-08-14
  • 2021-08-13
相关资源
相似解决方案