2016-08-22 4 views
0

の$ indexを取得します。ここにはVueを含むテーブルがあります。Vueは、2つのレベルのv-で

<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にはどうすればアクセスできますか?

+0

chartHeightとchartWidthの例を表示できますか? –

答えて

2
<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> 
関連する問題