我们开发中,总会遇到一些删除功能列表的操作,在小程序中,触屏左滑操作,即显示可操作删除按钮,下面就是我写的一个demo,供前端开发人员参考:
示例:
WXML:
<view class="container">
<view class="touch-item {
{item.isTouchMove ? 'touch-move-active' : ''}}" data-index="{
{index}}" bindtouchstart="touchstart" bindtouchmove="touchmove" wx:for="{
{itemlist}}" wx:key="">
<view class="content">{
{item.content}}</view>
<view class="del" catchtap="del" data-index="{
{index}}">删除</view>
</view>
</view>
wxss:
page{
background: #ccc;
}
.container{
width:100%;
overflow: hidden;
b