Is it possible to conditionally render a closing tag using v-if
? If so, what is the correct way to do it? Initially, I tried the following:
<template v-for="day in days">
<td class="days">{{day.number}}</td>
<template v-if="day.isSunday">
</tr>
<tr>
</template>
</template>
While this works, it does not render </tr><tr>
as raw HTML - is this the expected behavior?
If conditional rendering of closing tags is not possible, what is the best way to break a table row conditionally?
In my specific scenario, I have an array of days in a month with additional information. Each day has an isSunday
property, and I want to start a new row after each Sunday (simulating calendar behavior)