| | |
| | | // 表单的确认和取消 |
| | | import { onActivated, onDeactivated, ref, watch } from 'vue'; |
| | | import { useCloned } from '@vueuse/core'; |
| | | // import { useCloned } from '@vueuse/core'; |
| | | import { useMessageBoxTip, useMessageBox } from './messageBox'; |
| | | |
| | | export function useFormConfirm({ |
| | |
| | | // manual: true |
| | | // }).cloned.value; |
| | | formRef.value.clearValidate(); |
| | | formRef.value.resetFields(); |
| | | }; |
| | | |
| | | // 清空表单 |
| | | const clear = function () { |
| | | edit.value = false; |
| | | isReset = true; |
| | | formRef.value.resetFields(); |
| | | formObj.value = {} |
| | | }; |
| | | |
| | | // 提交成功后 |
| | |
| | | } |
| | | }; |
| | | |
| | | return { formObj, formRef, edit, active, onSubmit, onCancel, onReset }; |
| | | return { formObj, formRef, edit, active, onSubmit, onCancel, onReset, clear }; |
| | | } |