vue开发: then里面包着async, await
文章目录
async,await是配合使用的,一般的操作:
async test() {
const res = await ajax();
}then里面包着async, await的代码:
test() {
this.$confirm("是否提交?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
})
.then(async () => {
const res = await ajax();
})
.catch(() => { });
}
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论