Vue.component('my-component', {
template: '<div>A custom component!</div>'
})
// 创建根实例
new Vue({
el: '#example'
})
直接用的文档给的注册了,控制台报错:
Failed to mount component: template or render function not defined. (found in root instance)
求大神解答
Vue.component('my-component', {
template: '<div>A custom component!</div>'
})
// 创建根实例
new Vue({
el: '#example'
})
直接用的文档给的注册了,控制台报错:
Failed to mount component: template or render function not defined. (found in root instance)
求大神解答
13 回答12.8k 阅读
7 回答1.9k 阅读
9 回答1.7k 阅读✓ 已解决
6 回答941 阅读
3 回答1.1k 阅读✓ 已解决
3 回答1.3k 阅读✓ 已解决
2 回答1.2k 阅读✓ 已解决
我也遇到这个问题,你在webpack.config.js下加上
我也是加上这个就可以了,但是还有个问题就是虽然加上去了但是tempalte里的数据渲染不到页面上去
不知道你的会不会!!!