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

QCalendarScheduler model-resources property bug #427

Open
AskingATonOfQuestions opened this issue Oct 25, 2023 · 0 comments
Open

QCalendarScheduler model-resources property bug #427

AskingATonOfQuestions opened this issue Oct 25, 2023 · 0 comments

Comments

@AskingATonOfQuestions
Copy link

AskingATonOfQuestions commented Oct 25, 2023

To begin with, my project is built with quasar": "^2.6.0" on "vue": "^3.0.0".
Using composition API with <script setup lang='ts'> syntax.
The problem is that QCalendarScheduler doesnt work, when initializing q calendar with predefined model-resource property.

   <q-calendar-scheduler
    ref="calendar"
    v-model="selectedDate"
    v-model:model-resources="resources"
    resource-key="id"
    resource-label="name"
    bordered
    view="week"
    no-active-date
    hoverable
    animated
    short-weekday-label
    cell-width="2.1vw"
    :locale="$i18n.locale"
    :resource-min-height="0"
  />
      
const resources = ref([
    { id: 1, name: 'John' },
    { id: 2, name: 'Mary' },
    { id: 3, name: 'Susan' },
    { id: 4, name: 'Olivia' },
    { id: 5, name: 'Board Room' },
    { id: 6, name: 'Room-1' },
    { id: 7, name: 'Room-2' }
  ])

No errors or warnings in console, however, if resources initially is set to empty array ref:

const resources = ref([])

and after that I set it with delay like this:

 setTimeout(function () {
    resources.value = [
      { id: 1, name: 'John' },
      { id: 2, name: 'Mary' },
      { id: 3, name: 'Susan' },
      { id: 4, name: 'Olivia' },
      { id: 5, name: 'Board Room' },
      { id: 6, name: 'Room-1' },
      { id: 7, name: 'Room-2' }
    ];
  }, 1);

It works prefectly fine! Seems like there is a problem with timing.
Any suggestions?

@AskingATonOfQuestions AskingATonOfQuestions changed the title QCalendarSchduler model-resources property bug QCalendarScheduler model-resources property bug Oct 26, 2023
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

1 participant