[Vuejs]-How can I change row's active state value in v-data-table?

0👍

You are assigning the value to row.item.active so the active variable contains 'active' or 'not-active' instead of true or false that is why you always get 'not-active' since the row.item.active === true always resolves to false

<td :class="(row.item.active === true ? 'active' : 'not-active') + ' text-xs-right'">{{ row.item.active }}</td>

Updated Answer

<td class="text-xs-right">{{ row.item.active ? 'active' : 'not active' }}</td>

Leave a comment