4 years ago

v-bind:class has problem with hyphenated class names

Posted 4 years ago by JillzTom

If I use

v-bind:class="{ img-holder-selected : isUpload}"

I'm getting the following warning:

[Vue warn]: Invalid expression. Generated function body:  {scope.img-scope.holder:scope.isUpload}

and the error message: Uncaught TypeError: Cannot read property 'get' of undefined.

But If I use

v-bind:class="{ imgHolderSelected : isUpload}"

it's working well. Does that mean I cannot use hyphenated classes in vue?

Please sign in or create an account to participate in this conversation.