首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >FullCalendar + VUE:没有可用的FullCalendar视图插件

FullCalendar + VUE:没有可用的FullCalendar视图插件
EN

Stack Overflow用户
提问于 2021-03-23 18:27:01
回答 1查看 384关注 0票数 0

FullCalendar 4.4.2 + VUE

你好!我试图运行FullCalendar插件,但它不想工作。在此之前,我在另一台服务器上运行相同的程序集,一切都很好!这是我的连接代码。我正在使用FullCalendar 4.4.2插件

请告诉我插件错误可能有什么问题。他为什么不想发射?提前感谢您的帮助!

错误:没有可用的FullCalendar视图插件

代码语言:javascript
复制
<template>
    <div class="calendar-view">
        <app-overlay-loader v-if="preloader"/>
        <FullCalendar v-else :options="calendarOptions"/>
    </div>
</template>

<script>

import FullCalendar from "@fullcalendar/vue";
import dayGridPlugin from "@fullcalendar/daygrid";
import timeGridPlugin from "@fullcalendar/timegrid";
import interactionPlugin from "@fullcalendar/interaction";

export default {
    name: "Calendar",
    components: {
        FullCalendar
    },
    props: {
        options: {
            type: Object
        },
        preloader: {
            type: Boolean,
            default: false
        }
    },
    data() {
        return {
            initOptions: {
                plugins: [dayGridPlugin, timeGridPlugin, interactionPlugin],
                headerToolbar: {
                    left: 'title',
                    center: 'prev today next',
                    right: 'dayGridMonth,timeGridWeek,timeGridDay',
                },
                initialView: 'timeGridWeek',
                selectable: true,
                views: {
                    dayGridMonth: {
                        titleFormat: {month: 'long', year: 'numeric'}
                    },
                    timeGridWeek: {
                        titleFormat: {month: 'long', year: 'numeric'},
                        weekNumbers: true
                    },
                    timeGridDay: {
                        titleFormat: {day: 'numeric', month: 'long', year: 'numeric'},
                    }
                },
            }
        }
    },
    computed: {
        calendarOptions() {
            return {
                ...this.initOptions,
                slotLabelFormat: this.slotLabel
                , ...this.options
            }
        },
        slotLabel() {
            if (this.$store.state.settings.timeFormat === 12) return undefined;
            return {
                'hour12': false,
                'hour': '2-digit',
                'minute': '2-digit'
            }
        }
    }
}
</script>

错误

代码语言:javascript
复制
[Vue warn]: Error in mounted hook: "Error: No available FullCalendar view plugins."

found in

---> <FullCalendar>
       <Calendar> at resources/js/core/components/calendar/Calendar.vue
         <ActivityCalendar> at resources/js/crm/Component/Views/Activities/Calendar/ActivityCalendar.vue
           <CalendarView> at resources/js/crm/Component/Views/Activities/CalendarView.vue
             <Root>

日历不会装货。请帮我解决这个问题。谢谢!

EN

回答 1

Stack Overflow用户

发布于 2021-11-18 09:49:58

在自定义视图时,应该添加"type“属性,例如:

代码语言:javascript
复制
 views: {
                dayGridMonth: {
                    type: 'dayGridMonth',
                    titleFormat: {month: 'long', year: 'numeric'}
                },
                timeGridWeek: {
                    type: 'timeGridWeek',
                    titleFormat: {month: 'long', year: 'numeric'},
                    weekNumbers: true
                },
                timeGridDay: {
                    type: 'timeGridDay',
                    titleFormat: {day: 'numeric', month: 'long', year: 'numeric'},
                }
            },
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66769139

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档