添加删除按钮
<el-button type=“text” @click=“handleDeleteRow(scope.row)”>删除
1
openDelConfirm(name) {
return this.$confirm(此操作将删除 ${name}, 是否继续?
, ‘提示’, {
confirmButtonText: ‘确定’,
cancelButtonText: ‘取消’,
type: ‘warning’
})
},
handleDeleteRow(row) {
this.openDelConfirm(row.roleName).then(() => {
deleteOne(row.id).then(res => {
this.$message({
type: ‘success’,
message: ‘删除成功!’
})
this.fetchTableData()
})
}).catch(() => {
})
},
另一种实现删除时弹框提示
<el-popconfirm title=“确认删除吗?删除后不可恢复” @onConfirm=“del([row.id])”>
删除