We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vben Admin V5
当弹窗打开一次关闭后再次打开弹窗,通过Model的onConfirm 触发的await formApi.submitForm();不会执行到Form的handleSubmit.
文件: playground/src/views/examples/modal/form-model-demo.vue
playground/src/views/examples/modal/form-model-demo.vue
function onSubmit(values: Record<string, any>) { message.info(JSON.stringify(values)); // 只会执行一次 } const [Form, formApi] = useVbenForm({ handleSubmit: onSubmit, schema: [ { component: 'Input', componentProps: { placeholder: '请输入', }, fieldName: 'field1', label: '字段1', rules: 'required', }, ...... const [Modal, modalApi] = useVbenModal({ fullscreenButton: false, onCancel() { modalApi.close(); }, onConfirm: async () => { await formApi.submitForm(); modalApi.close(); }, onOpenChange(isOpen: boolean) { if (isOpen) { const { values } = modalApi.getData<Record<string, any>>(); if (values) { formApi.setValues(values); } } }, title: '内嵌表单示例', });
除非在onOpenChange 中重新设置setState
onOpenChange(isOpen: boolean) { if (isOpen) { const { values } = modalApi.getData<Record<string, any>>(); formApi.setState({ handleSubmit: onSubmit }); if (values) { formApi.setValues(values); } } },
node 22.7.0
No response
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Version
Vben Admin V5
Describe the bug?
当弹窗打开一次关闭后再次打开弹窗,通过Model的onConfirm 触发的await formApi.submitForm();不会执行到Form的handleSubmit.
Reproduction
文件:
playground/src/views/examples/modal/form-model-demo.vue
除非在onOpenChange 中重新设置setState
System Info
Relevant log output
No response
Validations
The text was updated successfully, but these errors were encountered: