This is my for loop:
<li v-for="(crumb, index) in breadcrumbs" :class="{ 'is-active' : index==breadcrumbs.length-1 }">
<a href="javascript:void(0)" v-if="index==breadcrumbs.length-1">{{ crumb.name }}</a>
</li>
@click="methodName" shouldn't be available for the last iteration.
I can check the last iteration with index==breadcrumbs.length-1 Is this possible using apply v-if?
@click
handler as usual, but in the callback simply check if the item is the last item. If it is the last item, return false or just doevent.preventDefault()
. – Oneupmanship