fix(MatCodeForm): 修复对话框关闭时的事件触发问题

This commit is contained in:
zxy 2026-03-20 15:36:15 +08:00
parent 21ca5bc98f
commit 0f2dd58b14

View File

@ -1,5 +1,5 @@
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible"> <Dialog :title="dialogTitle" v-model="dialogVisible" @close="emits">
<el-form <el-form
width="400px" width="400px"
ref="formRef" ref="formRef"
@ -34,7 +34,7 @@
</el-form> </el-form>
<template #footer> <template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button> <el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button> <el-button @click="emits"> </el-button>
</template> </template>
</Dialog> </Dialog>
</template> </template>
@ -112,6 +112,11 @@ const open = async (type: string, id?: number) => {
} }
defineExpose({ open }) // open defineExpose({ open }) // open
const emits = async () => {
dialogVisible.value = false
emit('success')
}
/** 提交表单 */ /** 提交表单 */
const emit = defineEmits(['success']) // success const emit = defineEmits(['success']) // success
const submitForm = async () => { const submitForm = async () => {