wml-scaffold
Version:
Generate file and folder structure from wml file
36 lines (29 loc) • 645 B
JavaScript
import Vue from 'vue';
Vue.component('form-component', {
data(){
return{
error:false,
sending:false,
send: false,
form: false
}
},
props: ['base'],
methods:{
handleSubmit(){
if( this.$refs.form.reportValidity() && !this.sending){
this.sending = true;
this.$http.post(this.$refs.form.getAttribute('action'), this.form).then(response => {
this.sending = false;
this.send = true;
}, response => {
alert(response.body.message);
this.sending = false;
});
}
}
},
created(){
this.form = this.base;
}
});