关于@click="delete"报错

// 购物车点击事件
		<div class="top">
            <span>购物车</span>
            <span @click="delete">编辑</span>
//报错'v-on' directives require that attribute
// value or verb modifiers.eslint(vue/valid-v-on)
        </div>
 methods: {
    fun () {
      console.log('监听到了')
      history.go(-2)
    },
    dj: function () {
      if (this.checked) {
        // 实现反选
        this.checkedNames = []
      } else {
        // 实现全选
        console.log('全选')
        this.checkedNames = []
        this.gw.forEach((item) => {
          this.checkedNames.push([item.money, item.count])
        })
      }
    },
    delete () {
      console.log('删除')
    }
  },

坑死我了这个delete居然是关键字,换一个名字就好

Logo

Vue社区为您提供最前沿的新闻资讯和知识内容

更多推荐