微信小程式左滑刪除未操作有復位效果

2022-06-07 06:42:10 字數 1952 閱讀 9231

>刪除

view

>

view

>

movable-view

>

movable-area

>

view

>

2.wxss

/*

pages/test/test.wxss

*/.page.m_a.data_list.d_box.data

3.js

//

pages/test/test.js

page(, , , ],

pcontrolwidth: 200,

},/*

* * 生命週期函式--監聽頁面載入

*/onload:

function

(options) ,

/** * 生命週期函式--監聽頁面初次渲染完成

*/onready:

function

() ,

/** * 生命週期函式--監聽頁面顯示

*/onshow:

function

() ,

/** * 生命週期函式--監聽頁面解除安裝

*/onunload:

function

() ,

/** * 觸控開始

*/touchs:

function

(e)

});//復位後,賦值

this

.setdata();

if (e.touches.length == 1) );}},

/** * 觸控移動

*/touchm:

function

(e)

else

if (disx > 0)

}this.data.plist[index].leftx = -left;

this

.setdata();

console.log(

this

.data.plist);

},/*

* * 觸控結束

*/touche:

function

(e)

})

微信小程式左滑刪除

view class touch item data index wx for wx key view class content view style class item data index bindtouchstart touchstart bindtouchmove touchmove b...

微信小程式 左滑刪除效果

1 wxml touch item元素繫結了bindtouchstart bindtouchmove事件 class container class touch item data index bindtouchstart touchstart bindtouchmove touchmove wx ...

微信小程式左滑效果

container touch item data index bindtouchstart touchstart bindtouchmove touchmove wx for wx key content del catchtap del data index 刪除 複製 touch item c...