我正在通过设置根据更改的选择元素更新资源列表,this.calendarOptions.resources
并且我还使用函数来获取事件。
当我将这些东西结合起来时,资源会显示出来,并且似乎会获取事件,但它们不会显示在时间轴中。我也在calendarAPI.refetchEvents()
更新资源后尝试过,看看是否有什么不同。事件已获取,但仍不显示。
如果我修复资源而不更新它,日历事件将成功显示。
任何可能发生这种情况的想法都非常感谢。
calendarOptions: {
resources: [],
events: this.getEvents
...
}
获取事件:
async getEvents(info) {
try {
const response = await this.$http.get(myurl)
return response.data.bookings
} catch (e) {
console.log(e)
}
}
获取资源:
async getResources() {
try {
const response = await this.$http.get(myresourceurl)
this.calendarOptions.resources = response.data.resources
} catch (e) {
console.log(e)
}
}
111