这几天一直在开发微信小程序,无奈得实现开发的各种要求,由于接触微信小程序时日不多,遂网上查阅各种资料,功夫不负有心人,找到了这一效果的源码,参考自 微信小程序联盟 原文链接
1、wxml touch-item元素绑定了bindtouchstart、bindtouchmove事件
<view class="container">
<view class="touch-item {
{
item.isTouchMove ? 'touch-move-active' : ''}}" data-index="{
{
index}}" bindtouchstart="touchstart" bindtouchmove="touchmove" wx:for="{
{
items}}" wx:key="">
<view class="content">{
{
item.content}}</view>
<view class="del" catchtap="del" data-index="