Tutorial by Examples

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. HTML <di...
In this example will render five <li> tags <ul id="render-sample"> <li v-for="n in 5"> Hello Loop </li> </ul>
<ul> <li v-for="n in 10">{{11 - n}} pigs are tanning at the beach. One got fried, and </ul> https://jsfiddle.net/gurghet/3jeyka22/
v-for can be used for iterating over an object keys (and values): HTML: <div v-for="(value, key) in object"> {{ key }} : {{ value }} </div> Script: new Vue({ el: '#repeat-object', data: { object: { FirstName: 'John', LastName: 'Doe', Ag...

Page 1 of 1