javascript - 事件不会出现在 vuejs 的完整日历中
问题描述
我在完整日历中显示事件时遇到问题。数据以正确的格式来自后端,当我在其中显示的属性title : "", start: "" and end: ""
中手动添加一些模拟数据时,但是当我说-> 来自后端的对象列表时,它不会出现。这是我的代码:events
calendarOptions
events: "this.listOfEvents"
<template>
<FullCalendar :options="calendarOptions" :events="calendarOptions.events" />
</template>
<script>
export default {
components: {
FullCalendar,
},
computed: mapGetters(["listOfEvents"]),
data: () => ({
// events: [],
user: JSON.parse(localStorage.getItem("loggedUser")),
startDateTime: moment()
.clone()
.format("D-M-YYYY h:mm:ss"),
endDateTime: moment()
.clone()
.format("D-M-YYYY h:mm:ss"),
calendarOptions: {
events: "this.listOfEvents", //this is where I am trying to bind it
// events: [
// {
// title: "dsegr",
// start: "2020-11-14 10:00:00.0" //if I manually do this with the data that comes from my
server it works
// }
// ],
},
}),
methods: {
getEventByUserAndDate() {
store.dispatch("getEventByUserAndDate", {
userId: this.user.id,
start: this.startDateTime,
end: this.endDateTime,
})
this.events = this.listOfEvents;
},
},
created() {
this.getEventByUserAndDate();
},
};
</script>
解决方案
推荐阅读
- r - 使用第二个数据帧值按值过滤数据帧
- java - 如何将两个 JTextfields 添加到“北”,否则我会在 java 中说类似的方向
- java - Java中正则表达式的结果超出了我的预期
- ios - Firebase:iOS:Firebase读取后数组为空
- c# - 是否可以重新设计 C# 方法接口以摆脱 `new string[] {}` 以提高可读性?
- .htaccess - 为什么这个 RewriteEngine 规则不起作用?
- c++ - Boost 线程、Posix 线程和 STD 线程,为什么它们提供不同的性能?
- javascript - 排序时在jquery数据表分页中保留页码
- vue-chartjs - 关于 vue-chartjs 的一些问题
- python - 如何将数据发送到要执行的不同语言,然后将答案发送回原始语言?