1.使用vuejs 官网上面的例子,在控制台中发现了错误了,
VM2369 vue.js:2658 [Vue warn]: Unknown custom element:
- did you register the component correctly? For recursive components, make sure to provide the "name" option.
(found in root instance)
2.源码:
Vue.component('todo-item', {
props: ['todo'],
template: '{{ todo.text }} '
})
var app7 = new Vue({
el: '#app-7',
data: {
groceryList: [
{ text: 'Vegetables' },
{ text: 'Cheese' },
{ text: 'Whatever else humans are supposed to eat' }
]
}
})
楼主应该是写反了,需要先注册组件,然后新建Vue