I have a vue js application which allows me to add items to an array.
After adding I'd like to add the ability against each item the ability to move the item up or down the array list.
I've tried the following but I don't think Vue.JS has the move method.
My Vue method:
changePos: function(item, type = 1) {
this.items.move(this.items, item, type);
},
My template calling the method:
<tbody>
<tr v-for="(item, key) in items">
<td>
<button class="btn btn-sm btn-rounded" @click="changePos(item,1)">UP</button>
<button class="btn btn-sm btn-rounded" @click="changePos(item,-1)">DOWN</button>
</td>
<td>@{{ item.code }}</td>
</tr>
</tbody>
I get the following error:
this.items.move is not a function