I am trying to pass data via an axios' post in a vue method and getting the error:
"signinVue.js:60 Uncaught TypeError: Cannot read property 'post' of undefined"
Vue script:
new Vue({
el:'#app',
data:{
email:'',
code:'',
},
methods:{
signin:function(){
console.log(this.email + ' ' + this.access);
let url = '../App/testConnection.php';
this.axios.post(url, {email:this.email, code:this.code})
.then((response) =>{
console.log(response);
})
.catch(function (error) {
console.log(error);
});
//console.log(this.email + ' ' + this.access);
//alert(this.email);
}
}
});
axios
package? – Ru Chern Chong