wxml:
<scroll-view scroll-into-view="{{id}}" scroll-y="true" scroll-with-animation="true" style="height: 100vh; position: relative;">
<block wx:if="{{ dataList.length }}">
<view class="item" id="{{ 'id_' + item.monitorDate }}" wx:for="{{ dataList }}" wx:key="index" bindtap="goToFunc" data-index="{{ index }}" data-date="{{ item.monitorDate }}">
<view class="name">{{ item.monitorDate }}</view>
<van-row>
<van-col span="6">执行次数:</van-col>
<van-col span="16" offset="2">{{!!item.instanceNum?item.instanceNum:'--'}}</van-col>
</van-row>
<van-row>
<van-col span="6">完成次数:</van-col>
<van-col span="16" offset="2">{{!!item.completeNum?item.completeNum:'--'}}</van-col>
</van-row>
</view>
</block>
<view wx:else class="empty">暂无数据</view>
</scroll-view>
js:
this.setData({
id: 'id_2024-04-03'
})
注:id不能以数字开头,并且不能包含文字,否则scroll-into-view
无效,页面不滚动