Fullcalendar+vue3 实现日程表

实现效果图

掘金文章链接 此处贴不上大的gif图片 跳转链接

框架:vue3+FullcalendaV6版本 官方地址

插件安装
    npm i @fullcalendar/core @fullcalendar/daygrid @fullcalendar/timegrid @fullcalendar/list @fullcalendar/interaction
其他工具依赖 dayjs
    npm i dayjs
插件引入
  import {
    Calendar } from '@fullcalendar/core';
  import dayGridPlugin from '@fullcalendar/daygrid';
  import timeGridPlugin from '@fullcalendar/timegrid';
  import listPlugin from '@fullcalendar/list';
  import interactionPlugin from '@fullcalendar/interaction';
  import dayjs from 'dayjs';
完整代码(直接复制就能看到效果)
<template>
  <div class="container">
    <a-card class="general-card">
      <div class="top-button">
        <a-space>
          <a-typography-title :heading="6">
            {
   {
    currentData }}
          </a-typography-title>
          <a-space>
            <a-button
              @click="
                Tcalendar.prev();
                dayTime();
              "
              ><icon-left
            /></a-button>
            <a-button
              @click="
                Tcalendar.next();
                dayTime();
              "
            >
              <icon-right
            /></a-button>
            <a-button
              type="primary"
              @click="
                Tcalendar.today();
                dayTime();
              "
              >今天</a-button
            >
          </a-space>
        </a-space>
        <a-radio-group v-model="type" type="button" @change="changeType">
          <a-radio value="dayGridMonth"></a-radio>
          <a-radio value="timeGridWeek"></a-radio>
          <a-radio value="timeGridDay"></a-radio>
          <a-radio value="listWeek"></a-radio>
        </a-radio-group>
      </div>
      <div ref="fullcalendar" class="card"> </div>
    </a-card>
    <!-- 详情抽屉 -->
    <a-drawer
      :width="480"
      :visible="visible"
      @ok="handleOk"
      @cancel="visible = false"
      title="面试详情"
    >
      <template #title> </template>
      <div
        >You can customize modal body text by the current situation. This modal
        will be closed immediately once you press the OK button.
      </div>
    </a-drawer>
  </div>
</template>

<script setup lang="ts">
  import {
    ref, nextTick, onMounted } from 'vue';
  import {
    Calendar } from '@fullcalendar/core';
  import dayGridPlugin from '@fullcalendar/daygrid';
  import timeGridPlugin from '@fullcalendar/timegrid';
  import listPlugin from '@fullcalendar/list';
  import interactionPlugin from '@fullcalendar/interaction';
  import dayjs from 'dayjs';

  const state = 
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值