Using vue to dynamically display elements (referred to as boxes) on the page poses a challenge for me. I need to determine whether to show an element based on whether its start date is before or after today plus one week.
If the box.start_date
falls before one week from today, then it should be displayed; otherwise, it should remain hidden.
I am uncertain about how to achieve this in vue.
For example:
<div class="box" v-if="box.start_date < ***the date that is 1 week from now***"> ... </div>
I attempted to use moment.js but encountered an error stating that moment is not defined in vue.
With Laravel and Blade, I would handle this situation like so...
@if($box->start_date > now()->addWeek(1))
How can I accomplish this in vue?