Level 41
Try it as a string as shown in the docs: http://vuejs.org/guide/class-and-style.html
v-bind:class="{ 'img-holder-selected' : isUpload}"
3 likes
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?
Try it as a string as shown in the docs: http://vuejs.org/guide/class-and-style.html
v-bind:class="{ 'img-holder-selected' : isUpload}"
Please or to participate in this conversation.