1. 程式人生 > >e應用swipe-action onRightItemClick獲取點選的當前項的資料

e應用swipe-action onRightItemClick獲取點選的當前項的資料

page.axml

定義sweipe-action節點的extra屬性:extra="{{item}}"
<list> <block a:for="{{list}}"> <swipe-action right="{{right}}" onRightItemClick="onRightItemClick" extra="{{item}}"> <list-item> </list-item> </swipe-action> </block> </list>

page.js

e.extra輸出即可
onRightItemClick(e){ console.log(e.extra); },