I have simple array with items in which I push new ones from time to time. New items comes via ajax;
items.push({id: 1, title: 'a'});
items.push({id: 2, title: 'b'});
items.push({id: 3, title: 'c'});
items.push({id: 4, title: 'd'});
The main thing is that I need to show them in reverse like:
- 4, d
- 3, c
- 2, b
- 1, a
The problem is that I cant use unshift as I need to have index to items as I will need to do interactions with specific items.
So basically I'm searching for a way to push items but show them like it was unshift. Not actually reverse array.
<li v-for="item in items | orderBy 'id' -1" track-by="id">should workid. I need to useindexinstead