[Vuejs]-How to display rows in Vue.js with different colors

0👍

Change

:style="{backgroundColor: color}"

to

:style="'background: ' + choseColor()'"

and

choseColor() {
            return ((this.counter % 2) !== 0) ? `grey` : 'white';
}

try it out. It should solve it.

Leave a comment