Closed furey closed 8 years ago
Unfortunately, it is in fact relatively expensive to add these aliases, because in Vue these properties need to be reactive, so each of them would have extra initialization and memory costs. It would be wasteful to always define them on every repeated fragment since they are not always used.
You can define custom methods like isLast
and just use it like
<li :class="{ active: isLast($index) }">
Understood. Cheers.
Would it be relatively inexpensive to add other special properties to
v-for
loops?For example (from the Angular docs):
I'm currently writing a breadcrumb component and a property like
$last
would simplify:into:
Interested to hear your thoughts!