Giter Site home page Giter Site logo

final-vuerm's Introduction

final-vuerm

Form management solution for Vue.js based on ๐Ÿ Final Form.

Installation

yarn add final-vuerm

or

npm install final-vuerm --save

Simple form example

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>

API

<Form>

Props:

config

Configuration used for creating a form instance. onSubmit is required.
https://github.com/final-form/final-form#config

Example:

{
  onSubmit: handleSubmit
}
subscriptions?

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
}

Events:

@update

Returns formState object.
https://github.com/final-form/final-form#formstate


<Field>

Props:

config?

Additional field configuration. This is where you can apply field-level validation.
https://github.com/final-form/final-form#fieldconfig

name

Name to register field values to. This is a required prop.
https://github.com/final-form/final-form#field-names

subscriptions?

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
}
type?

Input type. Default is text.

value?

Input value. Used for radio inputs. Use <Form> config prop to set initial values, otherwise they will not be recorded in state.

Events:

@update

Returns formState object.
https://github.com/final-form/final-form#fieldstate


<Select>

See props and events definitions from <Field>.

Props:

config?
name
subscriptions?

Events:

@update

<ResetButton>

Restores initial values.


<SubmitButton>

Submits the form.

final-vuerm's People

Contributors

katre159 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.