此处插入一个小知识点
页面刷新 window.location.reload()
验证
this.$refs["form"].validate((valid) => {
if (valid) {
postPermiss(this.form)
.then((res) => {
this.getpermiss();
this.$message({
message: "新增成功",
type: "success",
});
})
.catch((err) => {
this.$message.error("新增失败");
console.log(err);
});
// this.tableData.unshift({ ...this.form });
this.dialogVisible = false;
window.location.reload();
} else {
if (
this.form.caption === "" ||
this.form.menu_id === "" ||
this.form.url === ""
) {
this.$message.error("请将表格填写完整");
} else {
this.$message.error("请将表格填写完整");
}
}
});
this.$message.error(“请将表格填写完整”);