I am unable to do this:
<ul>
<li v-repeat="candy: candies">
<ul>
<li v-repeat="flavour: candy.flavours">
{{ candy.$index }}
</li>
</ul>
</li>
</ul>
Any work around?
I am unable to do this:
<ul>
<li v-repeat="candy: candies">
<ul>
<li v-repeat="flavour: candy.flavours">
{{ candy.$index }}
</li>
</ul>
</li>
</ul>
Any work around?
UPDATE 2:
v-fornow supports specifying an alias for$index: http://vuejs.org/api/#v-for That should allow you to avoid naming collisions on$index.UPDATE: VueJS 1.0 has deprecated
v-repeatin favor ofv-for. The same solution applies though.Try using
$parent.$indexto access an$indexin a parent scope.