Skip to content

Martin25699/form-vue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

form-vue

Vue Form constructor

Build Setup

install

npm i form-vue --save

How to

in app.js

import Vue from 'vue'
import axios from 'axios';
import formVue from 'form-vue';

Vue.use(formVue);

//For send requests
Vue.prototype.$http = axios || 'other';

Submit Form Method

this.$http[method](action,data)
    .then(response => {
        this.done(response);
    })
    .catch(response => {
        this._setErrors(response.errors);
        this.fail(response);
    });

Example

<form-main action="/" method="post" :done="FormDone" :fail="FormFail">
    <form-group name="key" :value="key" type="hidden"></form-group>
    <form-group name="name" :value="name" label="Name"></form-group>
    <form-group name="year" :value="year" type="select" :options="yearsRows" label="Year"></form-group>
    <form-group name="birthday" :value="birthday" type="date" label="Birthday"></form-group>
    <form-group name="desc" :value="desc" type="textarea" label="Description"></form-group>
    <form-submit text="Send Fail"></form-submit>
</form-main>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published