@detools/vue-form

    5.13.8 • Public • Published

    vue-form

    Form State Management for VueJS

    npm version npm downloads MIT license

    Installation

    npm i @detools/vue-form

    Usage

    import { mapActions } from 'vuex'
    import Form, { Input } from '@detools/vue-form'
    
    export default {
      data() {
        return {
          formValues: {},
        }
      },
    
      methods: {
        ...mapActions('cart', ['checkout']),
    
        handleSubmit(values) {
          return this.checkout(values)
        },
      },
    
      render() {
        return (
          <div>
            <h1>Basic Form</h1>
            <div class="wrapper">
              <div class="form">
                <Form cancel submit handleSubmit={this.handleSubmit} v-model={this.formValues}>
                  <Input formItem label name="username" />
                </Form>
              </div>
              <div class="values">
                <strong>Form Values</strong>
                <br />
                <br />
                <div>{JSON.stringify(this.formValues, null, 2)}</div>
              </div>
            </div>
          </div>
        )
      },
    }

    More Examples

    See source in example/src folder. See demo at https://detools-vue-form.netlify.com

    Available Connected Components

    Changelog

    Install

    npm i @detools/vue-form

    DownloadsWeekly Downloads

    227

    Version

    5.13.8

    License

    MIT

    Unpacked Size

    103 kB

    Total Files

    42

    Last publish

    Collaborators

    • isnifer