I am very new to vue. I am trying to execute a simple for loop, but for some reason it is not working. Any help will be appreciated. My code:
var Vue = require('vue');
Vue.use(require('vue-resource'));
Vue.http.headers.common['X-CSRF-TOKEN'] = document.querySelector('#token').getAttribute('value');
new Vue({
el: '#adresponse',
ready: function() {
this.fetchMessages();
},
data: {
classified_bids: {},
accept_qty: {},
submitted: false
},
methods: {
fetchMessages: function () {
this.$http.get('/api/getbids')
.success(function (bids) {
this.classified_bids = bids;
for (i = 0; i < this.classified_bids.length; i++) {
this.accept_qty[i] = 0;
}
});
}
}
});