richardtallent / vue-simple-calendar

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

Clicking & URL issues #216

Closed cpgb85 closed 1 year ago

cpgb85 commented 1 year ago

Clicking does absolutely nothing on items. here is what I have:

<calendar-view
                :show-date="showDate"
                :items="items"
                @click-item="onClickItem"
                @click-date="onClickItem"
                class="theme-default">
                <template #header="{ headerProps }">
                    <calendar-view-header
                        :header-props="headerProps"
                        @input="setShowDate" />
                </template>
</calendar-view>`

here is my methods where I retrieve the items and set them along with the click. Everything is being ignored:

onClickItem(e){
            alert('')
},
        async getMonthOrders(){
            let req, res;
            this.ready = false;
            req = await fetch(`${this.$store.state.api}/selectorder?lcCustno=${this.$root.getCustomerNumber()}&lclocation=${this.$route.query.lclocation}&ldfirstdate=${this.$root.moment(this.showDate).format('MM/DD/YYYY')}`);
            res = await req.json();
            this.orders = res;
            this.items = this.orders.map((order,i)=>{
                return {
                    id:`e${i}`,
                    startDate:order['document date'].date,
                    title:`View #${order['document no_']}`,
                    url:'https://google.com',
                };
            });
        },
richardtallent commented 1 year ago

Had to reformat your question to see it properly.

Event handler looks good, though it does nothing. Items look good, as far as I can tell.

Is the CalendarView component registered and rendering correctly?

If the calendar is appearing with the calendar items from the API call but the @click-item handler is not being called, please provide a reproducible repository with some fake items.

richardtallent commented 1 year ago

Stale, no reproduction provided, marking dead for now.