Is there a way to highlight rows in a table based on specific conditions? For example, when the fine is greater than zero (fine > 0) or the due date is later than today.
The current code works well for highlighting rows where issue.fine is greater than zero.
<tr v-for="issue in issues" :key="issue.id" :class="{'text-danger font-weight-bold': issue.fine > 0}">
<td>{{ issue.firstname}} {{ issue.lastname}}</td>
<td>{{ issue.datedue }}</td>
</tr>
However, I am looking to implement two conditions:
- When issue.fine is greater than zero OR
- When issue.datedue is after today's date
I attempted the following code but it did not produce the desired result.
<tr v-for="issue in issues" :key="issue.id"
:class="{'text-danger font-weight-bold': issue.fine > 0, issue.datedue > new Date()}">
<td>{{ issue.firstname}} {{ issue.lastname}}</td>
<td>{{ issue.datedue }}</td>
</tr>
If anyone has a solution to this problem, your help would be greatly appreciated. Thank you.