Form management solution for Vue.js based on 🏁 Final Form.
yarn add final-vuerm
or
npm install final-vuerm --save
import { Form, Field, Select, ResetButton, SubmitButton } from 'final-vuerm';
<Form :config="{ onSubmit: handleSubmit }">
<Field name="fieldName" />
<Select name="selectName">
<option>1</option>
<option>2</option>
<option>3</option>
</Select>
<ResetButton>Reset</ResetButton>
<SubmitButton>Submit</SubmitButton>
</Form>
Configuration used for creating a form instance. onSubmit
is required.
https://github.com/final-form/final-form#config
Example:
{
onSubmit: handleSubmit
}
Object containing the values you wish to be updated about.
https://github.com/final-form/final-form#formsubscription--string-boolean-
Example:
{
active: true,
dirty: true,
touched: true,
valid: true,
value: true
}
Returns formState
object.
https://github.com/final-form/final-form#formstate
Additional field configuration. This is where you can apply field-level validation.
https://github.com/final-form/final-form#fieldconfig
Name to register field values to. This is a required prop.
https://github.com/final-form/final-form#field-names
Object containing the values you wish to be updated about.
https://github.com/final-form/final-form#fieldsubscription--string-boolean-
Example:
{
dirty: true,
valid: true,
values: true
}
Input type. Default is text
.
Input value. Used for radio
inputs.
Use <Form>
config
prop to set initial values, otherwise they will not be recorded in state.
Returns formState
object.
https://github.com/final-form/final-form#fieldstate
See props and events definitions from <Field>
.
Restores initial values.
Submits the form.