0👍
You may looking for v-if
<span v-if=“status==‘pending’” >….
0👍
You can use v-if
directive:
<span class='pending' v-if="status === 'pending'">
pending
</span>
<span class='complete' v-else>
complete
</span>
See more details: https://v2.vuejs.org/v2/guide/conditional.html
- [Vuejs]-How to clear the vue warn when I use vue-slider-component?
- [Vuejs]-On key press update parent data from child Vue.js
0👍
If you have a bunch of different statuses, then you can have something like this in the template:
<span v-if="status" :class="status">{{ status }}</span>
The span will be displayed when status
is truthy and the class and inner text will be set to the status value.
Source:stackexchange.com