需求
el-table中,点击删除时的处理
先看代码和错误
handleModuleDelete(index, row) {
this.$confirm(`确认要删除模块?`, '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function () {
//其它业务逻辑处理
this.moduleList.splice(index,1);
}).catch((error) => {
console.log(error);
});
},
console中的出错信息:
TypeError: Cannot read properties of undefined (reading 'moduleList')
at eval (。。。。)
反复检查ÿ