[Vuejs]-Translate {{if @last}} handlebars templates to vue 2.0

2👍

There is no implementation for something like @last in Vue, as Evan You explained here that it will be costly to have such feature which are also used not that frequently for each v-for loop.

You can define a method isLast for this and use it like following:

<div v-if="isLast(index)">

JS

methods: {
  isLast (index) {      
    return this.list.length === index + 1
  }
}

Leave a comment