- <div id="app-7"><ol><!-- Now we provide each todo-item with the todo object --><!-- it's representing, so that its content can be dynamic --><todo-item v-for="item in groceryList" v-bind:todo="item"></todo-item></ol></div>Vue.component('todo-item', {props: ['todo'],template: '<li>{{ todo.text }}</li>'})var app7 = new Vue({el: '#app-7',data: {groceryList: [{ text: 'Vegetables' },{ text: 'Cheese' },{ text: 'Whatever else humans are supposed to eat' }]}})
关于Vue
最新推荐文章于 2024-05-22 16:30:00 发布
2101

被折叠的 条评论
为什么被折叠?



