Vue: v-repeat嵌套遍历时,如何在子循环中拿到上层的$index?

Created on 13 Oct 2015  ·  4Comments  ·  Source: vuejs/vue

<tr v-repeat="row:listdata.body" rowindex="{{$index}}">
            <td rowindex="{{$index}}" v-repeat="item:row" colindex="{{$index}}">{{item}}</td>
        </tr>

代码如上,我希望能在td中拿到tr的rowindex该如何获取呢?
谢谢 作者。

Most helpful comment

$parent.$index 不确定,试试看?

All 4 comments

$parent.$index 不确定,试试看?

@285858315 是这样的 万分感谢。

Thanks!

请问在vue2中怎么实现??

Was this page helpful?
0 / 5 - 0 ratings