Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using as ES6 module, events don't work #274

Closed
lukas-frey opened this issue May 27, 2024 · 5 comments
Closed

When using as ES6 module, events don't work #274

lukas-frey opened this issue May 27, 2024 · 5 comments

Comments

@lukas-frey
Copy link

Hello, whether I use events or eventSources, they do not appear in the calendar when using ES6 module configuration according to the documentation:

let ec = new Calendar({
                target: this.$el,
                props: {
                    plugins: [TimeGrid, DayGrid],
                    options: {
                        locale: 'cs',
                        firstDay: 1,
                        view: 'dayGridMonth',
                        events: [
                            {
                                start: '2024-05-03',
                                end: '2024-05-05',
                                title: 'event 1',
                                display: 'background',
                            },
                            {
                                start: '2024-05-02',
                                end: '2024-05-03',
                                title: 'event 2',
                            },
                        ]
                    },
                }
            });

Am I doing something wrong?

@lukas-frey lukas-frey changed the title When using as ES6 module, events don' work When using as ES6 module, events don't work May 27, 2024
@vkurko
Copy link
Owner

vkurko commented May 27, 2024

I prepared a demo based on your code and the events are displayed fine:

image

@lukas-frey
Copy link
Author

Hmm, not sure why it's not working then. I have it wrapped in an AlpineJS component, maybe that is causing issues. When I use ec.addEvent() it works though.

@vkurko
Copy link
Owner

vkurko commented May 28, 2024

Please provide a public demo so that I can reproduce the issue.

@vkurko
Copy link
Owner

vkurko commented May 30, 2024

@lukas-frey any update?

@lukas-frey
Copy link
Author

Hi, no, when I created a plain JS project on stackblitz using an Alpine component, it worked.

I use it in a project with Laravel, Livewire, AlpineJS and FilamentPHP. There's a lot of places where it could have gone wrong, so the error is somewhere on my side probably. Thanks for your help though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants