iNeoO / vue-meeting-selector

This component is inspired from the meeting selector from doctolib with the power of Vuejs components.
https://vue-meeting-selector.tuturu.io
95 stars 19 forks source link

Select or unselect a meeting by method call #44

Closed dlik closed 7 months ago

dlik commented 7 months ago

Hiya!

Is there any way to select or unselect an event by hand (i.e. by a method call)? I want to allow the user to select a maximum of two events. Thus, it would be great if there was a way to unselect the event that was just selected. I didn't find a way to do that in the documentation. Am I missing anything?

Thank you so much and kind regards

iNeoO commented 7 months ago

Hi,

You can use @change event

    <vue-meeting-selector
      ref="meetingSelector"
      class="meeting-selector"
      multi
      v-model="meeting"
      :date="date"
      :loading="false"
      :meetings-days="meetingsDays"
      @next-date="nextDate"
      @previous-date="previousDate"
      @change="change">
const change = (value: MeetingSlot[]) => {
      if (value.length > 2) {
        value.shift();
      }
    };
dlik commented 7 months ago

Thank you so much!!