Questions And Answers

More Tutorials

VueJs List Rendering


Basic Usage

A list can be rendered using the v-for directive. The syntax requires that you specify the source array to iterate on, and an alias that will be used to reference each item in the iteration. In the following example we use items as the source array, and item as the alias for each item.


<div id="app">
 <h1>My List</h1>
 <tr v-for="item in items">


new Vue({
 el: '#app',
 data: {
 items: ['item 1', 'item 2', 'item 3']

Only render HTML items

In this example will render five
<ul id="render-sample">
 <li v-for="n in 5">
 Hello Loop

Pig countdown list

 <li v-for="n in 10">{{11 - n}} pigs are tanning at the beach. One got fried, and

Iteration over an object

v-for can be used for iterating over an object keys (and values):


<div v-for="(value, key) in object">
 {{ key }} : {{ value }}


new Vue({
 el: '#repeat-object',
 data: {
 object: {
 FirstName: 'John',
 LastName: 'Doe',
 Age: 30


In this page (written and validated by ) you learned about VueJs List Rendering . What's Next? If you are interested in completing VueJs tutorial, your next topic will be learning about: VueJs Mixins.

Incorrect info or code snippet? We take very seriously the accuracy of the information provided on our website. We also make sure to test all snippets and examples provided for each section. If you find any incorrect information, please send us an email about the issue:

Share On:

Mockstacks was launched to help beginners learn programming languages; the site is optimized with no Ads as, Ads might slow down the performance. We also don't track any personal information; we also don't collect any kind of data unless the user provided us a corrected information. Almost all examples have been tested. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. By using, you agree to have read and accepted our terms of use, cookies and privacy policy.