2

I want to bind multiple class by vueJs but the code does not work. I am following the vue documentation of class binding topics. I am not able to find my error.

<a href="#" :class="[badge, badge-primary, ladda-button]>
2
  • 3
    You need quotes around your strings. e.g. 'badge-primary'. Otherwise they are treated as property names and minus signs. Commented Oct 11, 2019 at 16:51
  • Tnx bro, I mistake this single cotation as a stupid. Commented Oct 11, 2019 at 16:54

1 Answer 1

2

It's just formatted incorrectly.

:class="badge badge-primary ladda-button"

or....

:class="['badge', 'badge-primary', 'ladda-button']

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

1 Comment

Yea, I got my mistake. Afterall tnx a lot.

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.