html代码:
<el-tag
v-for="app in tenantApps"
:key="app.tenantAppRelaId"
class="tag"
closable
@close="handleDelete(app)"
>
{{ app.appName }}
</el-tag>
点击标签关闭的事件js,需要判定
handleDelete(row) {
this.tenantAppRelaId = row.tenantAppRelaId;
this.dialogTenantVisible = true;
deleteTenantApp(row.tenantAppRelaId)
.then(() => {
this.tenantMsg = `确定要删除 “${this.tenantName}“ 的 “${row.appName}“吗?`;
this.getTenantAuthedApps();
})
.catch(() => {
this.tenantMsg = `“${this.tenantName}“ 的 “${row.appName}“ 授权上存在关联数据,请再次确认是否要删除!`;
});
},
弹框确定事件
deleteCurrentTenant() {
sureDeleteTenantApp(this.tenantAppRelaId).then(() => {
this.$message.success('删除成功!');
this.getTenantAuthedApps();
});
},
要求是点击标签的关闭按钮弹一个框提示,点击确定后在删除标签。
现在是弹框弹出来,还没点击弹框确定紧接着标签就被删除了,这是怎么回事?
大佬帮忙指点一下
你直接运行deleteTenantApp了,不就直接删除了吗,你应该把deleteTenantApp放在弹框的确认事件中