Vue.js Vue在两个级别的v-for中获得$index
这是一张有Vue的桌子Vue.js Vue在两个级别的v-for中获得$index,vue.js,Vue.js,这是一张有Vue的桌子 <table> <tr v-for="height in chartHeight" track-by="$index"> <td class="item" v-for="width in chartWidth" track-by="$index"> index of row and column here </td> </tr> </t
<table>
<tr v-for="height in chartHeight" track-by="$index">
<td class="item" v-for="width in chartWidth" track-by="$index">
index of row and column here
</td>
</tr>
</table>
这里的行和列索引
高度$index
被内部宽度的高度覆盖。如何访问这两个$index
?
<table>
<tr v-for="(hid, height) in chartHeight" track-by="hid">
<td class="item" v-for="(wid, width) in chartWidth" track-by="wid">
{{ hid }}, {{ wid }}
</td>
</tr>
</table>
{{hid}},{{wid}
{{hid}},{{wid}
您能给出chartHeight和chartWidth的示例吗?您能给出chartHeight和chartWidth的示例吗?