这个删除的方法以id为参数,该参数在调用该方法时作为row-key传入。

delCate (id) {
  // 删除商品
  this.$confirm('此操作会彻底删除该分类,继续吗?', '删除分类').then(() => {
    delCate(id).then(res => {
      if (res.data.code === 200) {
        this.$message({
          type: 'success',
          message: res.data.msg,
          duration: 1500,
          onClose: () => {
            this.fetchCateLists()
          }
        })
      } else {
        this.$message({
          type: 'error',
          message: res.data.msg
        })
      }
    })
  })
}

在这个方法中,传入的id参数将作为row-key传递给delCate函数

这个删除的以id为参数 这个参数是这个嘛row-key=idscript import fetchCateLists delCate updateCate from apicate import SearchBar from componentsSearchBarvue import CateAdd from componentsCateAddvue import CateUpdate fro

原文地址: https://www.cveoy.top/t/topic/hOSF 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录