ant-design-vue关于Confirm内部中this指向问题
handleSubmit(params) {
const _this = this;
this.$confirm({
title: "操作提示",
content: "是否确认提交,并且设置商户级别为:认证商户",
onOk() {
console.log("ok");
_this.$emit("handleSubmit");
},
onCancel() {
console.log("Cancel");
},
});
//
},
Confirm使用遇到的坑,使用const再次定义,在confirm内部即可使用
本文探讨了在Ant Design Vue中,如何解决Confirm弹窗内this指向困扰,通过const重新定义this并确保在操作确认和取消时正确触发事件。

被折叠的 条评论
为什么被折叠?



