5

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?

1 Answer 1

9

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

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, when nesting: " > '

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.