Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Toggle a CSS class in Vue 2.0

In vue 1 I was doing this: v-bind:class='{"isdanger": invalidLogin}'.

Now I'm trying to do the same in a Vue 2 app but I'm getting this error:

template syntax error - invalid expression: v-bind:class="{'isdanger': invalidLogin}"

I'm using pug, just in case.

Any ideas?

like image 780
Mati Tucci Avatar asked Sep 07 '16 22:09

Mati Tucci


1 Answers

Sigh, I changed it to double quotes like this: v-bind:class="{'is-danger': true}" and now it works.

like image 51
Mati Tucci Avatar answered Oct 10 '22 22:10

Mati Tucci