javascript - 在 fullcalendar v4 事件中添加按钮
问题描述
在我的 fullcalendar v4.3.1 应用程序中,我想将一些带有 jsvascript 功能的按钮添加到事件示例中,并决定将其设置为:
window.calendarEventsObject = new FullCalendar.Calendar(calendarEl, {
plugins: ['dayGrid'],
eventRender: function (eventInfo) {
eventInfo.el.querySelector('.fc-title').append("<i class='fa fa-external-link pull-right'>7890</i>");
// I see text in title , but not html element, as I expected
// eventInfo.el.querySelector('.fc-title').html("<i class='fa fa-external-link pull-right'>7890</i>");
// If to uncomment the lline above I got error eventInfo.el.querySelector(...).html is not a function
},
events: eventsList,
showNonCurrentDates: false,
editable: true,
allDaySlot: true,
selectable: true,
selectHelper: true,
selectOverlap: false,
fixedWeekCount: false,
aspectRatio: 0.4,
height: 700,
});
哪种方式有效?
谢谢!
解决方案
推荐阅读
- python - 如何输出我在 Python pandas 中的类中制作的字典
- android - Android自定义库访问内部类
- python-3.x - 将 select() 和 TCP Keepalive 与 Python 套接字一起使用的问题
- java - 为什么在 XSSFRow 中使用 copyRowFrom(...) 时出现 IllegalArgumentException?
- wso2is - WSO2 IS 中用于签署 JWT 令牌的密钥库是什么
- visual-studio - 如何在 VS 2017 C# 文本编辑器中删除所有代码换行符
- swift - 从结构中获取数据以在表视图中使用
- node.js - 照片上传者向客户端发送响应
- python - 编辑 CSV 文件(同时读取和写入)
- javascript - 每次刷新我注册的页面,都会打印2次,如何解决?