props: {
groups: Array,
},
computed: {
groups: function(arr) {
alert('hi')
}
},
<div v-for="(item, index) in groups" :key="item.id" :id="item.id" class="group-name" @click="isOnlySelected ? null : $emit('setSelectedItem', item.id)">
</div>
What is the best way to change the position of elements in an array received from an API on the frontend?
I have successfully displayed all the values from the API on the frontend. However, I now need to implement a condition where I can re-arrange the array values. For example, I want to move the element at position 6 to position 1 in the array.