richardtallent / vue-simple-calendar

Simple Vue component to show a month-grid calendar with events
MIT License
883 stars 162 forks source link

How can we get the selected object from the array? #217

Closed serkankuyu closed 1 year ago

serkankuyu commented 1 year ago

When I call the related method, all the data comes, but I only want to get the selected object from the array. I just couldn't do it.

// Component
<calendar-view :show-date="showDate" :items="items"
         @click-item="sendDataMeeting(items)"
           class="theme-default holiday-us-traditional holiday-us-official">
          <template #header="{ headerProps }">
                        <calendar-view-header :header-props="headerProps" @input="setShowDate" />
                    </template>
                </calendar-view>

// Methods

// Call methods
        sendDataMeeting(items) {
            this.$emit("sendDataMeet", items);
            console.log(items);
        },
// Data Items
listMetting() {

            axios.get(// this is url)
                .then((response) => {

                    this.items = response.data.dataMeeting.map((meet) => {
                        return {
                            id: meet.id,
                            startDate: meet.meetingDate,
                            endDate : meet.meetingDateFinish,
                            title: meet.meetingTitle'
                        };
                    });

                })

        },
richardtallent commented 1 year ago

Sorry, I don't understand the question. This seems like a question about Vue itself, not about this component.