// html
<div :data-id="item.id">小明</div>
// vue
getdata:function(e){
console.log(e.srcElement.dataset.id)
}
// html
<div :data-id="item.id">小明</div>
// vue
getdata:function(e){
console.log(e.srcElement.dataset.id)
}
转载于:https://www.cnblogs.com/sunday123/p/11504788.html