vue+vant删除提示框
import{Dialog }from"vant";components:{[Dialog.name]:Dialog},data(){return{honorList:[]};},delete(index){constid=this.honorList[index].id;...
·
import { Dialog } from "vant";
components: {
[Dialog.name]: Dialog
},
data() {
return {
honorList: []
};
},
delete(index) {
const id = this.honorList[index].id;
Dialog.confirm({
title: "提示",
message: "是否确定删除该荣誉?"
})
.then(async () => {
const res = await delete({ id }); //调用删除接口
if (res.code == "success") {
this.honorList.splice(index, 1);
}
})
.catch(() => {});
}
更多推荐
已为社区贡献1条内容
所有评论(0)