Vue: Want to use v-for and v-if. And depended on the v-if i want to change the class of the tr tag

Created on 30 Mar 2016  ·  2Comments  ·  Source: vuejs/vue

I can have 2 loops of v-for but that will mess up my order. I have googled and couldnt find anything, expect for angular which has a classodd and classeven. Is there something like that for vue ?

Most helpful comment

Fixed it. I used v-bind:class and just changed my webapi. Made it retun true or false and with it i was able to fix it.
http://vuejs.org/guide/class-and-style.html

All 2 comments

Fixed it. I used v-bind:class and just changed my webapi. Made it retun true or false and with it i was able to fix it.
http://vuejs.org/guide/class-and-style.html

I can have 2 loops of v-for but that will mess up my order

Just so you know, you can iterate group of things: <template v-for='...'>

Was this page helpful?
0 / 5 - 0 ratings