vue.js - 如何使用 eventDataTransform 在 FullCalender Vue 中传递自定义数据
问题描述
我有每个事件的自定义数据点(例如 event.organizer)。我希望这包含在活动部分的日历中。
我查看了文档(https://fullcalendar.io/docs/eventDataTransform),但它非常松懈,尤其是在 Vue 组件方面(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>
推荐阅读
- javascript - 数组中每小时的平均值
- server - 如何在 Centos7 服务器上附加额外的卷
- excel - 具有计数约束的 Excel Solver LP
- dart - Future builder(future:) 正在递归我的 http 请求,
- python - 我的主机上的套接字编程问题
- php - array_keys 除了正确的结果返回错误的结果
- amazon-web-services - AWS CodePipeline:如何获得一个阶段的最后一次成功执行?
- powershell - PowerShell:用户未登录时系统找不到文件
- django - 使用 Django Rest Framework 向远程服务发出 post 请求
- c# - Asp.Net Core WebApi 的身份验证失败并显示“Unprotect ticket failed”