Vue lists – List of items used in a web page to group a set of related name or items, in a specific order or in no particular order. There are several other instructions. In Vue each described with its own special functionality. For example, v-for directive can be used to display a list of items using data from an array.
We will show you a display that can use instructions for V-for render a list of items based on an array. In Vue.js the V-for Directory requires a special syntax in the item’s order. For example
Try This Example:
<script src="https://unpkg.com/vue"></script> <div id="app"> <p>{{ title }}</p> </div> <div id="app2"> <ol> <li v-for="list in lists"> {{ todo.text }} </li> </ol> </div> <script type="text/javascript"> var app = new Vue({ el: '#app', data: { title: 'Welcome Vue JS Tutorial' } }) var app2 = new Vue({ el: '#app2', data: { lists: [ { text: 'Learn HTML' }, { text: 'Learn CSS' }, { text: 'Learn JavaScript' } ] } }) </script>
Related posts