WingNews logo WingNews
top | new | best | ask | show | jobs
top | item 21555818

(no title)

aliveupstairs | 6 years ago

the docs:

https://vuejs.org/v2/guide/class-and-style.html#Binding-HTML...

https://vuejs.org/v2/guide/class-and-style.html#Array-Syntax

In your template:

a) <div :class={active: isActive} />

b) <div :class="{isActive? 'active' : 'inactive' }"/>

discuss

order

earthboundkid|6 years ago

B) is not valid. It needs to be wrapped in an Array, not an Object.
powered by hn/api // news.ycombinator.com