I'm trying to dynamically disable a specific link in a list generated by Vue.js. Here is my current implementation:
<ul>
<li class="nav-item" :key="id" v-for="(item, id) in listOfItems">
<a class="nav-link" :id="item.id">{{ item.name }}</a>
</li>
</ul>
Essentially, I want to disable a single link from the listOfItems
based on certain conditions and then re-enable it once those conditions change. Applying a conditional class like this impacts all items in the list:
:class="[someCondition = 'something' ? 'disabled' : '']"
How can I specify which item should be disabled when the condition is true?