vue中使用FullCalendar在移动端的点击拖拽功能

vue中使用FullCalendar插件时,在pc端点击拖拽是正常的,但是在移动端时,点击没有反应。

我也是在官网找了好大一会才找到答案><

官方文档Touch Support - Docs | FullCalendar

 可以看到文档的触控事件里有三种方式,可以根据自己需要去选择,官网都有详细说明。

 

 然后直接在vue里面用即可

下面是移动端效果图

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
Vue定制FullCalendar自定义视图,可以按照以下步骤进行: 1. 首先,需要在Vue项目安装FullCalendar插件,可以使用npm命令进行安装: ```shell npm install --save @fullcalendar/vue @fullcalendar/daygrid ``` 2. 在Vue组件引入FullCalendar插件,并注册FullCalendar组件: ```javascript <template> <FullCalendar :plugins="calendarPlugins" :initialView="calendarView" /> </template> <script> import FullCalendar from '@fullcalendar/vue' import dayGridPlugin from '@fullcalendar/daygrid' export default { components: { FullCalendar }, data() { return { calendarPlugins: [dayGridPlugin], calendarView: 'dayGridMonth' } } } </script> ``` 3. 接下来,可以使用FullCalendar提供的API来自定义视图。例如,可以使用`headerToolbar`属性来自定义日历的头部工具栏: ```javascript <template> <FullCalendar :plugins="calendarPlugins" :initialView="calendarView" :headerToolbar="calendarHeader" /> </template> <script> import FullCalendar from '@fullcalendar/vue' import dayGridPlugin from '@fullcalendar/daygrid' export default { components: { FullCalendar }, data() { return { calendarPlugins: [dayGridPlugin], calendarView: 'dayGridMonth', calendarHeader: { left: 'prev,next today', center: 'title', right: 'dayGridMonth,timeGridWeek,timeGridDay' } } } } </script> ``` 4. 可以使用`slot`来自定义日历的内容。例如,可以使用`dayContent`插槽来自定义每个日期格子的内容: ```javascript <template> <FullCalendar :plugins="calendarPlugins" :initialView="calendarView"> <template #dayContent="{ date }"> <div class="custom-day-content">{{ date.getDate() }}</div> </template> </FullCalendar> </template> <script> import FullCalendar from '@fullcalendar/vue' import dayGridPlugin from '@fullcalendar/daygrid' export default { components: { FullCalendar }, data() { return { calendarPlugins: [dayGridPlugin], calendarView: 'dayGridMonth' } } } </script> <style> .custom-day-content { background-color: #f0f0f0; border-radius: 50%; width: 30px; height: 30px; line-height: 30px; text-align: center; } </style> ``` 以上是在Vue定制FullCalendar自定义视图的基本步骤和示例代码,可以根据具体需求进行自定义。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值