[Vuejs]-How to write dynamic variable name in Vue's class binding ternary operator?

0👍

I think you’re over thinking this, to be honest with you. Why not set the active index as a data variable, then you can just do:

:class="[VARIABLE HERE === `flag-${index}` ? 'partition-active': '', 'partition']

Leave a comment