条件与循环
<div id="list-rendering" class="demo">
<ol>
<li v-for="todo in todos">
{{ todo.text }}
</li>
</ol>
</div>
.demo {
font-family: sans-serif;
border: 1px solid #eee;
border-radius: 2px;
padding: 20px 30px;
margin-top: 1em;
margin-bottom: 40px;
user-select: none;
overflow-x: auto;
}
const ListRenderingApp = {
data() {
return {
todos: [
{ text: 'Learn JavaScript' },
{ text: 'Learn Vue' },
{ text: 'Build something awesome' }
]
}
}
}