两个问题:
- 下拉刷新如何避免触发longtap事件?
- longtap事件监听中如何获取绑定的数据对象?
烦请高手解答一下,谢谢!
<div class="mui-content" id="userList">
<ul id="list" class="mui-table-view">
<li class="mui-table-view-cell mui-media" v-for="item in items">
<a href="javascript:;" :data-guid="item.id" >
<div>
<div style="float: right;">{{item.name}}</div>
<div>{{item.city}}</div>
</div>
</a>
</li>
</ul>
</div>
mui('#list').on('longtap','li',function(){
mui.alert("执行了长按");
console.log("执行了长按");
// TODO 这里如何获取到li元素中绑定的数据对象?
});
var orderVue = new Vue({
el: '#userList',
data: {
//列表信息流数据
items: [
{id: 1,name:'USER1', city:'CITY1'},
{id: 2,name:'USER2', city:'CITY2'},
{id: 3,name:'USER3', city:'CITY3'},
{id: 4,name:'USER4', city:'CITY4'},
{id: 5,name:'USER5', city:'CITY5'}
]
}
});