1

How can I interpolate classes in css with vue?

{{ category.icon }} --> "icon1"

I want to be able to do:

<i :class="category.icon" class="icon icon-"></i>

This will output:

<i class="icon icon- icon1"></i>

How can I remove the spacing?

How is this achieved in vue?

1 Answer 1

1

So you want which space to be removed? Want to have icon-icon1?
Then go for

:class="`icon-${category.icon}`"
Sign up to request clarification or add additional context in comments.

Comments

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.