优化editDialog.vm模板,添加重置表单
This commit is contained in:
parent
5988869763
commit
6918575663
@ -15,7 +15,7 @@
|
||||
}
|
||||
<template>
|
||||
<div class="@(@Model.LowerClassName)-container">
|
||||
<el-dialog v-model="state.isShowDialog" :width="800" draggable="" :close-on-click-modal="false">
|
||||
<el-dialog v-model="state.isShowDialog" :width="800" draggable="" :close-on-click-modal="false" :before-close="cancel">
|
||||
<template #header>
|
||||
<div style="color: #fff">
|
||||
<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Edit /> </el-icon>
|
||||
@ -324,13 +324,20 @@ const openDialog = async (row: any) => {
|
||||
const closeDialog = () => {
|
||||
emit("reloadTable");
|
||||
state.isShowDialog = false;
|
||||
resetForm();
|
||||
};
|
||||
|
||||
// 取消
|
||||
const cancel = () => {
|
||||
state.isShowDialog = false;
|
||||
resetForm();
|
||||
};
|
||||
|
||||
// 重置表单
|
||||
const resetForm = () => {
|
||||
ruleFormRef.value.resetFields();
|
||||
}
|
||||
|
||||
// 提交
|
||||
const submit = async () => {
|
||||
ruleFormRef.value.validate(async (isValid: boolean, fields?: any) => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user