微信小程序如何实现listview带字母滑动

  介绍

这篇文章主要介绍微信小程序如何实现listview带字母滑动,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!

<强>微信小程序实现listview带字母滑动

<强> wxml

, & lt; !——字母滑动——比;   ,& lt; view 类=發etter-position",天气:如果=皗{filterType ==, & # 39;名字# 39;}}“,隐藏=皗{letterShow ? & # 39;真正的# 39;:& # 39;& # 39;}},,,catchtouchstart=癶andlerAlphaTap", catchtouchmove=癶andlerMove", catchtouchend=癶andlerEnd"比;   & lt;才能image 类=皀o-stars  star-icon", data-loc=癶ttps://www.yisu.com/zixun/star", src=" . ./img/no-stars.png ">   <文本类="信"天气:="{{组}}”天气:项="集团" data-loc="{{组。id}}”天气:关键=" L_ {{group.id}} ">   {{group.id}}      <文本类="信没有信">   #      
 & lt; scroll-view  scroll-into-view=皗{locationTo}}“, bindscrolltolower=皁nscrollLower", scroll-y=皗{真}},,,bindscroll=皊croll", scroll-top=皗{scrollTop}}“,隐藏=皗{favoriteCards.length==0,,,, starCards.length ==0}}“在

<强> js

handlerAlphaTap (e), {   var 才能;ap =, e.target.dataset.loc;,//字母   this.setData({才能   ,,locationTo:美联社   ,,});      var 才能;list =, this.data.groups;   this.offsetTop 才能=,(this.data.clientHeihgt 安康;list.length  *, 16),/, 2;      },      ,handlerMove (e), {   var 才能;_this =,;   var 才能;list =, this.data.groups;   var 才能;moveY =, e.touches [0] .clientY;   var 才能;rY =, moveY 作用;this.offsetTop;   if 才能;(rY 祝辞=,0),{   ,,var  index =, Math.ceil ((rY 安康;16),/,16);   ,,if  (=0, & lt; index ,,, index  & lt;, list.length), {   ,,,_this.setData ({   ,,,,locationTo:,(指数).id列表,   ,,,,nonwApID:,(指数).id列表,   ,,,,飞:,假的,   ,,,,//nonwAp:,列表(指数)   ,,,});   ,,,//,_this.setData ({   ,,,//,nonwApID: _this.data.nonwAp.id   ,,,//,}),,   ,,}      ,,}   },   ,handlerEnd (e), {//,,,,试着{   this.setData({才能   ,,,nonwApID: & # 39; & # 39;   ,,,飞:没错,   ,,//locationTo: this.data.nonwAp.id   ,,});//才能,}捕捉(e) {//才能,}   var 才能;_this =,;   this.setData({才能   ,,scoTTTTp: e.currentTarget.dataset.scrollTop   ,,});      },

以上是“微信小程序如何实现listview带字母滑动”这篇文章的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注行业资讯频道!

微信小程序如何实现listview带字母滑动