const dataForm = {
food: this.$store.state.currentFood ? this.$store.state.currentFood.title : 'Заявка из каталога',
phone: this.phoneValue
}
const options = {
method: 'POST',
headers: { 'content-type': 'application/x-www-form-urlencoded' },
data: qs.stringify(dataForm),
url : '/ajax/send.php'
}
axios(options)
.then(({data}) => {
console.log(data);
this.formSended = true;
setTimeout(()=>this.formSended = false, 5000)
this.isLoading = false;
this.phoneValue = ''
})
.catch(error => {
console.error(error);
this.isLoading = false;
})
"scripts": {
"serve": "vue-cli-service serve",
"watchhh": "npm run development --watch",
"watch": "vue-cli-service development --watch",
"build": "vue-cli-service build
},