My Vue.js bound HTML includes the following:
<span :class="[obj.status === 'Online' ? 'badge-success' : obj.status === 'Updating' ? 'badge-warning' : 'badge-danger', 'badge badge-pill']">{{obj.status}}</span>
I am looking to introduce a new variant:
If obj.status === 'Updating'
, then I want the class to be badge-warning
.
What is the most efficient way to achieve this? I believe adding another ternary within the existing one might make it look cluttered.