0
我對vue非常陌生。我試圖執行一個簡單的for循環,但由於某種原因,它不工作。任何幫助將不勝感激。我的代碼:不能在vue.js中執行for循環
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;
}
});
}
}
});