quasar-ui-qcalendar icon indicating copy to clipboard operation
quasar-ui-qcalendar copied to clipboard

QCalendarScheduler model-resources property bug

Open AskingATonOfQuestions opened this issue 8 months ago • 0 comments

To begin with, my project is built with quasar": "^2.6.0" on "vue": "^3.0.0". Using composition API with

   <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 avatar Oct 25 '23 09:10 AskingATonOfQuestions