如何使用 eventData Transform 在 FullCalendar Vue 中传递自定义数据
How to pass custom data in FullCalender Vue with eventDataTransform
我有每个事件的自定义数据点(例如 event.organizer)。我希望将其包含在活动部分的日历中。
我查看了文档 (https://fullcalendar.io/docs/eventDataTransform), but it is pretty slacking, especially in regards to the Vue component (https://fullcalendar.io/docs/vue)
任何人都可以协助了解 Vue 组件的外观吗?我需要添加道具吗?以下无效。
import { resources, events } from "/mockdata.js";
<FullCalendar @eventDataTransform="eventDataTransform" :options="calendarOptions" />
export default {
components: {
FullCalendar,
},
data() {
return {
calendarOptions: {
plugins: [dayGridPlugin, interactionPlugin, resourceTimelinePlugin],
initialView: "resourceTimeline",
initialDate: "2021-06-18",
resources,
events,
},
};
},
methods: {
eventDataTransform: function(json) {
console.log(json)
},
},
};
<FullCalendar :options="calendarOptions">
<template v-slot:eventContent='arg'>
<i>{{ arg.event.extendedProps.organizer }}</i>
</template>
</FullCalendar>
我有每个事件的自定义数据点(例如 event.organizer)。我希望将其包含在活动部分的日历中。
我查看了文档 (https://fullcalendar.io/docs/eventDataTransform), but it is pretty slacking, especially in regards to the Vue component (https://fullcalendar.io/docs/vue)
任何人都可以协助了解 Vue 组件的外观吗?我需要添加道具吗?以下无效。
import { resources, events } from "/mockdata.js";
<FullCalendar @eventDataTransform="eventDataTransform" :options="calendarOptions" />
export default {
components: {
FullCalendar,
},
data() {
return {
calendarOptions: {
plugins: [dayGridPlugin, interactionPlugin, resourceTimelinePlugin],
initialView: "resourceTimeline",
initialDate: "2021-06-18",
resources,
events,
},
};
},
methods: {
eventDataTransform: function(json) {
console.log(json)
},
},
};
<FullCalendar :options="calendarOptions">
<template v-slot:eventContent='arg'>
<i>{{ arg.event.extendedProps.organizer }}</i>
</template>
</FullCalendar>