I am looking to enhance a list by adding a subheader. Currently, a subheader is added to every entry with today's date, but I want it to be set only once. The issue arises when trying to access the updated value of todaySubheader
within the <span v-if="todaySubheader
.
Here is the HTML code snippet:
<template v-for="(meetup, index) in filteredItems">
<v-subheader
v-if="checkIsToday(meetup.date)"
inset
>
<span v-if="todaySubheader === false">TODAY</span>
</v-subheader>
And here is the SCRIPT code snippet:
data () {
return {
todaySubheader: false,
[...]
checkIsToday (val) {
if (val && this.todaySubheader === false) {
this.todaySubheader = true
}
return isToday(new Date(val))
},
Is there a way to effectively retrieve the updated value of this.todaySubheader in the v-if="todaySubheader condition?