refactor(CURD): ♻️ 优化和修改使用示例

This commit is contained in:
cshaptx4869
2024-08-13 14:47:09 +08:00
parent 24c1fb26a0
commit 0964c71b2e
6 changed files with 55 additions and 60 deletions

View File

@@ -133,7 +133,7 @@
<template #footer>
<div>
<el-button type="primary" @click="handleSubmit"> </el-button>
<el-button @click="handleCloseModal"> </el-button>
<el-button @click="handleClose"> </el-button>
</div>
</template>
</el-drawer>
@@ -285,7 +285,7 @@
<template #footer>
<div style="padding-right: var(--el-dialog-padding-primary)">
<el-button type="primary" @click="handleSubmit"> </el-button>
<el-button @click="handleCloseModal"> </el-button>
<el-button @click="handleClose"> </el-button>
</div>
</template>
</el-dialog>
@@ -399,15 +399,19 @@ const handleSubmit = useThrottleFn(() => {
}
ElMessage.success(msg);
emit("submitClick");
handleCloseModal();
handleClose();
});
}
});
}, 3000);
// 隐藏弹窗
function handleClose() {
modalVisible.value = false;
}
// 关闭弹窗
function handleCloseModal() {
modalVisible.value = false;
formRef.value?.resetFields();
nextTick(() => {
formRef.value?.clearValidate();