Releases: fergaldoyle/vue-form
4.2.0
Add debounce option
4.1.2
update dist files
4.1.1
bump version
4.1.0
Added reset listener, which automatically calls _reset
. You need to handle resetting of your data model yourself.
e.g:
<vue-form :state="formstate" v-model="formstate" @submit.prevent="onSubmit" @reset="onReset">
methods: {
onReset: function() {
// set model back to original (usually stored in a clone)
this.model = JSON.parse(JSON.stringify(this.clonedModel));
}
}
4.0.3
version bump
4.0.2
Added reset method
<vue-form ref="form" :state="formstate">
resetState: function () {
this.formstate._reset();
// or
this.$refs.form.reset();
}
4.0.0
You can now set different configuration options for different forms (previously it was a global config)
Some API changes to achieve this:
vueForm
renamed to VueForm
because it is now a constructor.
Adding validators and setting config has changed:
config.classes.input
, config.classes.form
, config.classes.validate
are now:
config.inputClasses
, config.formClasses.
, config.validateClasses
vueForm.addValidator
removed. Set validators with config.validators
object.
vueForm.config
removed. Set config with Vue.use(VueForm, options)
or mixins: [new VueForm(options)]
Thanks to @kaleb
3.1.2
detect global for SSR
3.1.1
Added support for scoped slots, e.g:
<field-messages name="fieldName">
<span>Success</span>
<template slot="required" scope="state">
<span v-if="state.$touched || state.$submitted">Name is a required field</span>
</template>
</field-messages>
3.0.1
Replace form-error and from-errors with field-messages.
Added auto-label option