Skip to content

Interface: UseFormOptionsWithDeps<FormDefinition> ​

Defined in: vue/src/use-form.ts:27

Options of useForm for a definition that needs dependencies.

Extends ​

Type Parameters ​

Type Parameter
FormDefinition

Properties ​

PropertyModifierTypeDefault valueDescriptionInherited fromDefined in
depsreadonlyMaybeRefOrGetter<DepsOf<FormDefinition>>undefinedThe root's dependencies. A ref or a getter is followed with setDeps.-vue/src/use-form.ts:29
focusElement?readonlyFocusElementOptionelement => element.focus()How an element is focused, for error focus and node.focus().CreateFormOptions.focusElementcore/src/form/form-types.ts:26
formatError?readonlyFormatErrorOptionerror => error.codeTurns an error into text, for errorMessage and error summaries.CreateFormOptions.formatErrorcore/src/form/form-types.ts:28
id?readonlystringformtree-<counter>Prefix of every DOM id in the form, as in checkout:contact.email.CreateFormOptions.idcore/src/form/form-types.ts:38
initialValue?readonlyDeepPartial<DraftOf<FormDefinition>>undefinedThe starting draft. It may be partial; anything left out starts empty.CreateFormOptions.initialValuecore/src/form/form-types.ts:40
mode?readonlyValidationMode'onTouched'When errors become visible. Definitions can override it.CreateFormOptions.modecore/src/form/form-types.ts:15
reValidateMode?readonlyReValidateMode'onChange'When errors update after a node that contains them is submitted. Until then, mode decides. Definitions can override it.CreateFormOptions.reValidateModecore/src/form/form-types.ts:22
shouldFocusError?readonlyFocusErrorOptiontrueWhere focus goes after a failed submit.CreateFormOptions.shouldFocusErrorcore/src/form/form-types.ts:24

Released under the MIT License.