Switch CSS class in Vue 2.0

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

Now I'm trying to do the same in a Vue 2 application, but I get this error:

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

I use pug , just in case.

Any ideas?

+5
source share
1 answer

Sigh, I replaced it with double quotes as follows: v-bind:class="{'is-danger': true}" and now it works.

+9
source

All Articles