My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

How to use computed property in the class names

Yashu Mittal's photo
Yashu Mittal
·Jun 12, 2019

I have a computed property name danger which returns some data in string format, but it is not working.

:class="{
            't-button__primary': !outline,
            't-button__disabled': disabled,
            't-button__outline': outline,
            danger
        }"

and statically showing the danger as class name while rendering inside the DOM.