vuex form submit code example
Example 1: vue submit reloads page
<form @submit.prevent="onSubmit"></form>
<script>
export default {
methods: {
onSubmit () {
// Do something...
}
}
};
</script>
Example 2: submit form in vue
//HTML
<div id="vueRoot">
<form ref="form">
<input name="vitalInformation" v-model="store.vital">
<a href="#" v-on:click="submit">SUBMIT</a>
</form>
</div>
//JS
vm = new Vue({
el : "#vueRoot",
methods : {
submit : function(){
this.$refs.form.submit()
}
}
});