I have Laravel 10 / vuejs 3 app I try to use index variable in for construction :
<tr v-for="(cartItem, index) in cartItems" :key="cartItem.id">
<td class="px-4 py-3">index::{{ index }};; {{ cartItem.id }}
to remove element by this index :
function removeFromItems(index) {
cartItems.splice(index, 1)
...
But I see on the page that index equals cartItem.id, so deleting does not work properly.
What is wrong ?