Createapp() called for every event in fullcalendar vue3
See original GitHub issueI don’t know why no-one has mentioned this yet, but everytime I make an event the Createapp()
function in the package itself gets called. This means that when I have 1000 events there will be 1001 vue apps created (1 extra because I create the vue app myself). Here is my vue component which I can call in my blade templates:
<template>
<FullCalendar ref="fullCalendar"
:options="calendarOptions"
>
<template v-slot:eventContent='arg'>
<div class="flex w-full absolute inset-0 items-center"
:id="arg.event.id"
@click="openModal(arg.event.id)">
<p class="font-bold">
{{ arg.timeText }}
</p>
<p class="ml-2">
{{ arg.event.title }}
</p>
</div>
</template>
</FullCalendar>
</template>
<script>
import '@fullcalendar/core/vdom'
import FullCalendar from '@fullcalendar/vue3'
import dayGridPlugin from '@fullcalendar/daygrid'
import listPlugin from '@fullcalendar/list';
export default {
components: {
FullCalendar
},
data() {
return {
calendarOptions: {
plugins: [dayGridPlugin, listPlugin],
initialView: this.layout,
events: this.events,
eventClick: this.openModal,
eventTimeFormat: {
hour: '2-digit',
minute: '2-digit',
meridiem: false,
hour12: false
}
},
}
},
props: {
layout: String,
events: Array
},
}
</script>
And in my blade template:
<calendar
:layout="'dayGridMonth'"
:events="[
@foreach($lessons as $lesson)
{
id: '{{$lesson->id}}',
title: '{{$lesson->student->firstname}} {{$lesson->student->surname}} - {{$lesson->instructor->firstname}} {{$lesson->instructor->surname}}',
start: '{{$lesson->date}}T{{$lesson->time}}',
cancelled: {{ $lesson->cancelled }}
},
@endforeach]"
></calendar>
As you can see I loop through my lessons which I’ll pass as the events
. I’ll provide a screenshot in which you can see this bug occuring.
Issue Analytics
- State:
- Created 10 months ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Vue 3 (beta) support · Issue #131 · fullcalendar ...
I installed the fullcalendar library to my Vue 3 project but when I serve ... buildWatchers() { let watchers = { // watches...
Read more >Vue Component - Docs
FullCalendar seamlessly integrates with the Vue JavaScript framework. It provides a component that exactly matches the functionality of ...
Read more >retrieving and storing Events in database to and from ...
I've deployed FullCalendar v5 as a Vue 3 component inside a laravel 9 site using Breeze for authentication and Inertia for speedy rendering....
Read more >How to integrate Fullcalendar in Laravel 8 Vue.js 3
php artisan make:model Event -mf. It will generate a migration and factory. Let's go to our migration, located database/migrations, open the event migration ......
Read more >Reactive Full Event Calendar with Vue 3 - YouTube
How to create a reactive event calendar using Vue.js 3 and full calendar with multiple features such as day grid, time grid, drag...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@keygun-development, thanks, I’ve identified this as a performance issue as well.
I’ve fixed this in the latest v6-beta releases
Implementations vue3: https://github.com/fullcalendar/fullcalendar-vue/blob/vue3-v6/src/FullCalendar.ts#L38 vue2: https://github.com/fullcalendar/fullcalendar-vue/blob/vue2-v6/src/FullCalendar.ts#L40
Released in v6.0.0