Suppose we have a tag that utilizes a ternary operator to apply alignment:
<td
:class="alignment ? ('u-' + alignment) : null"
>
This functions as intended since the pre-defined alignment classes are in place, now if we want to add another attribute to this tag, for example adding the class u-bright
only if the prop isBright
is true:
<td
:class="{'u-bright' : isBright}"
>
How can we include both conditions within the same tag? Perhaps something like:
/** This obviously does not work */
<td
:class="{
alignment ? ('u-' + alignment) : null,
'u-bright' : isBright
}"
>