I'm not able to add multiple dynamic styles in vue.
Originally it looks like this: (The correct height shows up)
:style="minHeight ? `min-height:${getCSSUnit(minHeight,'inital')}` : ''"
But then I wanted to add another style, hasCss, and from what I've seen I can add another style as show below based on Vue js bind multiple style properties to an element:
:style="[minHeight ? `min-height:${getCSSUnit(minHeight,'inital')}` : '', hasCss]"
Problem is that the hasCss styles shows up but the minHeight doesn't. I thought maybe it has to do with the order of the styles but having:
:style="[hasCss, minHeight ? `min-height:${getCSSUnit(minHeight,'inital')}` : '']"
results in the same thing. In fact, as soon as I put the [] the minHeight style stops working. What am I doing wrong?
The hasCss computed property looks like:
hasCss() {
return {
'--color': this.textColour
}
}