scroll-view组件的scroll-into-view属性获取不到元素id?

小程序 文章 2021-12-24 10:40 7 0 全屏看文

scroll-view组件的scroll-into-view属性获取不到元素id?The scroll-into-view property of the scroll-view component cannot get the element id?

scroll-view组件的scroll-into-view属性获取不到元素id?

bindscroll="swichNav"函数获取不到元素id

<scroll-view scroll-y="true" scroll-with-animation="true" refresher-enabled="true" enhanced="true" scroll-into-view="{{rowView}}" scroll-top="{{scrollTop}}" bindscroll="swichNav" class="task_view" style="height:{{menuHeight}}px">    <view class="item_scroll">      <block wx:for="{{task}}" wx:for-index="index" wx:key="item">        <text id="row_{{index}}" style="color: #ffffff;">{{item.time}}</text>        <view wx:for="{{item.shop}}" wx:for-item="items" wx:key="item" class="shop">          <text>{{items.name}}</text>          <text class="shop_order">20</text>          <view class="flex-center shop_info">            <image class="avatar_35" mode="aspectFill" lazy-load="true" src="/uploads/cj/article/2021/12/24/38f4f8bd8a7011892bab1ed768e76a93.jpg"></image>            <view class="flex-center"> <text>距您</text> <text>1230/m</text>            </view>          </view>        </view>      </block>    </view>  </scroll-view>

bindscroll="swichNav"函数

swichNav: function (e) {    console.log(e.currentTarget);  },




bindscroll="swichNav"函数获取不到元素id {{item.time}} {{items.name}} 20 距您 1230/m bindscroll="swichNav"函数 swichNav: function (e) { console.log(e.currentTarget); }, 

回答:

社区技术运营专员-horanzhou:

请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

叶子🍃:

我们以前的项目一直都是根据滚动距离估算的,有段时间没了解了,现在还是取不到id吗?

游戏结束べ:
scroll-into-view是滑动到这个id的位置,并不是只显示这个id的内容


brave:

具体描述一下?

-EOF-