File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,12 @@ export interface FormProps<T extends object> {
3636 * @defaultValue `true`
3737 */
3838 transform? : boolean
39+ /**
40+ * When `true`, all form elements will be disabled on `@submit` event.
41+ * This will cause any focused input elements to lose their focus state.
42+ * @defaultValue `true`
43+ */
44+ loadingAuto? : boolean
3945 class? : any
4046 onSubmit? : ((event : FormSubmitEvent <T >) => void | Promise <void >) | (() => void | Promise <void >)
4147}
@@ -64,7 +70,8 @@ const props = withDefaults(defineProps<FormProps<T>>(), {
6470 return [' input' , ' blur' , ' change' ] as FormInputEvents []
6571 },
6672 validateOnInputDelay: 300 ,
67- transform: true
73+ transform: true ,
74+ loadingAuto: true
6875})
6976
7077const emits = defineEmits <FormEmits <T >>()
@@ -213,7 +220,7 @@ const loading = ref(false)
213220provide (formLoadingInjectionKey , readonly (loading ))
214221
215222async function onSubmitWrapper(payload : Event ) {
216- loading .value = true
223+ loading .value = props . loadingAuto && true
217224
218225 const event = payload as FormSubmitEvent <any >
219226
You can’t perform that action at this time.
0 commit comments