You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using QCalendarAgenda with composition API and script setup syntax, with latest QCalendar.
My question is how I best can set initial values for the calendar, like selected data, view and weekdays. The reason I ask is because I seem to get a double initial load when setting these on onMounted(), which often can cause a blank calendar afterwards.
Basic example
The url for the route contains date as a param: /cal/date/2024-05-23.
Surely the right thing to do then is to initiate the calendar with that date set.
A more involved example would also contain other settings like view, weekday etc. And date can come from Pinia, local storage, whatever. And yes, when fetching data from external source, I use async/await.
However, this seems to lead to:
The calendar initiates with todays date (and loads the calendar content for that default view)
The content shows very briefly
The selected date from url is set, leading to events firing (and loads the content I want)
More often than not the calendar content ends up blank for some reason.
So I assume I'm doing something wrong initiating it.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello 👋🏻
I'm using QCalendarAgenda with composition API and script setup syntax, with latest QCalendar.
My question is how I best can set initial values for the calendar, like selected data, view and weekdays. The reason I ask is because I seem to get a double initial load when setting these on onMounted(), which often can cause a blank calendar afterwards.
Basic example
The url for the route contains date as a param:
/cal/date/2024-05-23
.Surely the right thing to do then is to initiate the calendar with that date set.
A more involved example would also contain other settings like view, weekday etc. And date can come from Pinia, local storage, whatever. And yes, when fetching data from external source, I use async/await.
However, this seems to lead to:
So I assume I'm doing something wrong initiating it.
Anyone that can share some best practices?
Regards,
Ole
Beta Was this translation helpful? Give feedback.
All reactions