Recycle use v-for instructions.

v-for instructions need to be specified with site in sites special grammar of form sites is a source data array and site is an alias for the iteration of array elements.

v-for can bind data to an array to render a list:

2.9.1. v-for example

<div id="app"> <ol> <li v-for="site in sites"> {{ site.text }} li> ol> div> <script> const app = { data() { return { sites: [ { text: 'Google' }, { text: 'Runoob' }, { text: 'Taobao' } ] } } } Vue.createApp(app).mount('#app') script>    

v-for an optional second parameter is also supported, whose value is theindex of the current item:

2.9.2. v-for example

index is the index value of the list item:

<div id="app"> <ol> <li v-for="(site, index) in sites"> {{ index }} -{{ site.text }} li> ol> div> <script> const app = { data() { return { sites: [ { text: 'Google' }, { text: 'Runoob' }, { text: 'Taobao' } ] } } } Vue.createApp(app).mount('#app') script>    

Template