新增凭证列表 getVoucher thisloading = true; if thisqueryParamsvoucherGroupId !== null const params = voucherGroupId thisqueryParamsvoucherGroupId voucherQueryL
在handleDelete方法中,虽然调用了delVoucherGroupRelList方法删除数据,但是删除成功后并未更新页面的数据。可以在删除成功后,手动更新页面的数据,或者重新调用getVoucher方法获取最新的凭证列表数据。下面是更新页面数据的示例代码:
.then(() => {
return delVoucherGroupRelList(formData);
})
.then(() => {
this.msgSuccess("删除成功");
// 更新页面数据
this.getVoucher();
})
.catch((error) => {
console.log(error);
});
或者:
.then(() => {
return delVoucherGroupRelList(formData);
})
.then(() => {
this.getVoucher().then(() => {
this.msgSuccess("删除成功");
});
})
.catch((error) => {
console.log(error);
});
这样在删除成功后,页面数据会被更新,不再残留被删除的数据。
原文地址: https://www.cveoy.top/t/topic/i4D9 著作权归作者所有。请勿转载和采集!