添加删除按钮
<el-button type="text" @click="handleDeleteRow(scope.row)">删除</el-button>
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])">
<el-button slot="reference" type="text">删除</el-button>
</el-popconfirm>
版权声明:本文为weixin_50328560原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。