jeudi 12 août 2021

How to increase counter in v-if in Vue

I have an if condition: <tr v-if="!findTickets(tickets, date).length"><td>No ticket available</td></tr> and what I am trying to do increase the counter whenever the condition is true.

So I am confused about syntax and the way to do it.

Here is my findTickets function:

findTickets(tickets, date) {
            return tickets.filter((ticket) => {
                return (
                    ticket.date.getDate() === date.getDate() &&
                    ticket.date.getMonth() === date.getMonth() &&
                    ticket.date.getFullYear() === date.getFullYear() &&
                    this.getWeekNumber(ticket.date) === this.currentWeekNumber
                );
            });
        },

Thanks...

Aucun commentaire:

Enregistrer un commentaire