2👍
✅
<div v-bind:class="{ 'myClass1': sender_id === sender_id, 'myClass2': sender_id !== sender_id }" class="otherClass"></div>
1👍
Use ternary operation:
<span :class="todo.sender_id === sender_id ? 'delivered' : 'arrived'">{{message}}</span>
👤Ritu
Source:stackexchange.com