小程序-锚链接

设置点击,跳转到页面的指定位置的方式。

在下面的 scroll-into-view属性设置 v_id 值,就会跳转到指定 id 数据的位置。其中id开头不能是数字。

<scroll-view  scroll-y="true" scroll-into-view="{{v_id}}"   scroll-with-animation="true"   class="main">
    <view wx:for="{{list}}"  class="item" id="{{item}}"  >
      {{item}}
    </view>
</scroll-view>

 

posted @ 2026-01-04 17:25  微宇宙  阅读(6)  评论(0)    收藏  举报