前端确认是能够接收到后端的数据而且跟前端预设的数据一模一样但是就是无法显示到前端上
我使用的fullcalendar版本是6.1.7,events使用数组形式[],fullcalendar文档是英文的,例子比较少就没发现这种方法,
解决方法
调用fullcalendar API进行事件移除
let calendarApi = this.$refs.calendar.getApi()
let events = calendarApi.getEvents();
if (events.length > 0) {
_.forEach(events, event => {//_此处的下划线来自于Lodash,需要导入才能不报错
event.remove()
})
}
调用fullcalendar API进行事件添加
let calendarApi = this.$refs.calendar.getApi()
calendarApi.addEvent(event)
以上方法来自于vue中使用fullcalendar插件events无法动态渲染解决方案
vue中使用fullcalendar插件events无法动态渲染解决方案
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/198870.html