So I am really new to this Vue.js
and what I am trying to achieve is simple, I am trying to append the results of this Ajax
request into my list
<div id="app">
<button v-on:click="buttonClick">Test</button>
<ul id="example-1">
<li v-for="t in test">
{{ t }}
</li>
</ul>
</div>
<script>
var app = new Vue({
el: '#app',
data: {
'message': 'hello world',
'test': null
},
methods: {
buttonClick: function() {
axios.get('api/getdata')
.then(function(response) {
test = response.data;
//if this was Jquery I'd use $('li').append here
})
.catch(function(error) {
});
}
}
})
</script>
Now the problem is I don't know how to do it, my variable test
should hold all the data and then I should just loop it as I did, but how I trigger it again once I got the data?
EDIT: Just to clarify, I am not asking question about "this" and "self" I am asking on how to APPEND this data onto some HTML element