vue 动态绑定多个class
2019-12-10 本文已影响0人
一包
需要用到多个表达式来决定class的时候,使用模板字符串
<span
class="list-predictive-val"
:class="
`${item.glmProbability < 25 ? 'bg-success' : ''}${
item.glmProbability > 50 ? 'bg-danger' : ''
}`
"
>
{{ item.glmProbability }}%
</span>