1.使用vuejs 官網(wǎng)上面的例子,在控制臺(tái)中發(fā)現(xiàn)了錯(cuò)誤了,VM2369 vue.js:2658 [Vue warn]: Unknown custom element: <todo-item> - did you register the component correctly? For recursive components, make sure to provide the "name" option. (found in root instance)2.源碼:<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' }
]
}
})
Vuejs 使用官網(wǎng)上面的例子
開(kāi)滿天機(jī)
2018-10-19 14:38:02