(Vue.js新增)我从get请求中获取数据以显示日历信息.我希望每5分钟更新一次.
文档中没有关于自动重新加载的内容——我该如何实现这一点?我是在文件中使用标准javascript还是其他什么?
我的完整apply.js如下:
Vue.component('events', {
template: '#events-template',
data: function() {
return {
list: []
}
},
created: function() {
this.fetchEventsList();
},
methods: {
fetchEventsList: function() {
this.$http.get('events', function(events) {
this.list = events;
}).bind(this);
}
}
});
new Vue({
el: 'body',
});