M
M
Michael2017-09-24 18:18:14
Vue.js
Michael, 2017-09-24 18:18:14

How to render a list with custom style in vue.js?

There is a list in which one of the columns should change its class depending on the condition, how to do it?

<tr v-for="tick in ticket">
    <td>${ tick.title }</td>
    <td>${ tick.priority }</td>
     <td v-if="tic.closed" class="P2CL2TBTDesc">
         ${ tick.description }
    </td>
     <td v-else class="P2CL2TBTDesc asc">
         ${ tick.description }
    </td>
</tr>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2017-09-24
@DJWOMS1

Probably, instead of using v-if/ v-else, you should add a property to the array elements that will indicate the need to assign a class. Will it go like that ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question