question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Createapp() called for every event in fullcalendar vue3

See original GitHub issue

I 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. image

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

0reactions
arshawcommented, Dec 15, 2022

Released in v6.0.0

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found