Tell me how to convert?

<th v-repeat="options.cols">{{$index}}</th> 

at

 <th v-for="options.cols">{{$index}}</th> 

Must fill in headers from 0 to 4.
Thank.

 var grid = new Vue({ el: "#grid", data: { options: { rows: 5, cols: 5 } } }); 
 <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.16/vue.min.js"></script> <div id="grid"> <table> <thead> <!-- КАК ПРЕОБРАЗОВАТЬ? ?? --> <th v-repeat="options.cols">{{$index}}</th> <!-- <th v-for="options.cols">{{$index}}</th> --> </thead> </table> </div> 

    1 answer 1

    We look at the documentation .

     new Vue({ el: '#root', data: { cols: 5 } }); 
     <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.16/vue.min.js"></script> <div id='root'> <div v-for="(i, _i) in cols" :key="_i">{{ i }}, {{ _i }}</div> </div> 

    • Dear Other! Thank you very much! - Anton