如果是新建页
cancel(formName) {
this.$confirm(
"此操作将清空此次编辑的信息,恢复页面初始信息,是否继续?",
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}
)
.then(() => {
this.$refs[formName].resetFields();
this.$message({
type: "success",
message: "重置成功!"
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消重置"
});
});
},
如果是编辑页,重新加载初始数据,不要清空数据
cancel(formName) {
this.$confirm(
"此操作将清空此次编辑的信息,恢复页面初始信息,是否继续?",
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}
)
.then(() => {
this.getDate()
this.$message({
type: "success",
message: "重置成功!"
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消重置"
});
});
}
3549

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



