使用 @ 修饰符(或 v-on:,更多用法可以参考Vue文档)替代小程序事件中的 bind,在事件处理函数中可以用 stopPropagation 阻止事件冒泡:

一、绑定事件

  1. @tap=" "
  2. v-on:tap
  1. # 传值
  2. @tap="handleClick(item.id)"
  1. # 写在methods
  2. methods:{
  3. handleClick(id){
  4. console.log(id)
  5. }
  6. }