fullcalendar插件在vue3项目中的应用

vue 版本3.2.45 fullcalendar及插件 版本6.1.7 样式使用的是tailwindcss,可使用内联样式,效果一样的

插件的安装引用

1.安装fullcalendar插件

必须安装的插件:

npm install @fullcalendar/core

npm install @fullcalendar/vue3

必须安装一个:

npm install @fullcalendar/daygrid

npm install @fullcalendar/multimonth

npm install @fullcalendar/timegrid

拖拽必须安装的插件:

npm install @fullcalendar/interaction

vue文件中引用

import FullCalendar from "@fullcalendar/vue3"

汉化时必须引入:

import locale from "@fullcalendar/core/locales/zh-cn"

拖拽时需引入

import interactionPlugin, { Draggable } from "@fullcalendar/interaction"

template端

<fullCalendar :option="calendarOptions" style="width:100%" ref="fullcalendarref" />

template端 需要拖动的div

<div
    class="h-[350px] space-y-2"
    id="eventListItems"
    ref="eventListItems"
>
    <div
        v-for="(item,index) in eventList"
        class="rounded p-1 text-white pl-2 eventListItems"
        :class="item.colorclass"
        :draggable="true"
        :key="index"
        :id="item.eventId"
    >
         <span :id="item.color">{
   {
    item.eventName }}</span>
    </div>
</div>

js代码

script setup中编写option具体参数意义已注释,也可以查看https://fullcalendar.io/docs#toc

const calendarOptions = 
  • 4
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值