MuaathAlhaddad
4/1/2020 - 2:00 AM

reverse array in vuejs

there is no a direct function where you can insert it into your directive <div v-for="item in items">

However, you should use computed property such as

Vuejs

data: {
  items:['telephone', 'cover', 'sticker'];
}, 
computed: {
  reverseItems: function() {
    return this.items.reverse();
  }
}

HTML

<div v-for="item in reverseItesm">