[Vuejs]-Simplest v-for example doesn't work in <li v-for="todo in todos">

1👍

Your list is outside of the main div element, so it won’t be part of the component’s template.

Fix is:

<body>
    <div id="app">
       <span v-if='show'>{{ message }}</span>
       <ol>
           <li v-for="todo in todos">
               {{ todo }}
           </li>
       </ol>
    </div>
</body>

Leave a comment