does someone of you know, what the correct way of dynamically binding the content
tailwind class in vuejs3/nuxtjs3 is? Let’s assume, that const isExpanded = true
<h1 :class="{'after:content-[`:`]' : isExpanded}">Hello</h1>
I have tried it with backticks (`) but it ain’t working.
Please help.
2
Answers
Use
to escape the inner apostrophes
'
so they don’t prematurely close the outer stringAs one of the solutions, instead of binding CSS classes to an object, you can bind to an array, as in the example: