Is there a way for me to add dynamic styling depending what the result in my div will be?
I have created a function which will calculate a total number and then change the data property to return either 'Low' or 'Good' depending on what the count will be.
I have two different classes which I have created:
.good-result {
color: green;
font-weight: bold;
}
.poor-result {
color: orange;
font-weight: bold;
}
My dynamic styling looks like this
<div class="resultValue">Water intake: <span :class="'Low'?'poor-result' : 'good-result'">{{ resultsWater }}</span></div>
If the data property resultsWater says 'Low' I want to try and apply the .poor-result style else the .good-result property, currently it only displays the .poor-result no matter if the divs value is 'Low' or 'Good'
'Low'will always evaluate to true.