i have a simple form like so
<form @submit.prevent="getSummary">
<input type="text" v-model="userAcccount" placeholder="Enter Account
Number">
<button type="submit" class="btn btn-xs btn-default">Submit</button>
</form>
and the getSummary method in my methods object in vue is like this
methods: {
getSummary () {
axios.get('core/handle.php', {
params: {
accountNumber: this.userAcccount
}
})
.then(function (response) {
this.userData = response.data;
console.log(this.userData);
})
.catch(function (error) {
alert(error);
});
}
}
my data object contains
data: {
userAcccount: '',
userData: []
},
i am trying to update the userData with the response from axios and then use it to populate a table for testing purposes i just tried this
<span v-if="userData.length > 0">
some data
</span>
<span v-else>
data not found
</span>
console.log shows me the userData has be updated but this bit of code above doesn't change.