I'm trying to test my code with axios on local but i get that error Object { message: "Network Error", name: "AxiosError", code: "ERR_NETWORK", etc...
I tried to change adress to full http://localhost/contact/send & again but with ip... nothing of these works.
Can someone help me fix that issue
My code:
export default {
name: 'App',
components: {},
data() {
return {
name: '',
email: '',
message: '',
allowSend: false,
sent: false
}
},
methods: {
sendMessage() {
axios.post('/contact/send', {
name: this.name,
email: this.email,
msg: this.message
})
this.sent = true
setTimeout(() => {
this.sent = false
}, 3000)
},
checkProps() {
let nameCheck = false
let emailCheck = false
let msgCheck = false
if(this.name !== '') nameCheck = true
if(validator(this.email)) emailCheck = true
if(this.message !== '') msgCheck = true
if(nameCheck && emailCheck && msgCheck) this.allowSend = true
}
},
template
}