"Failed to mount component: template or render function not defined" 在简单组件中
"Failed to mount component: template or render function not defined" in simple component
我正在尝试从vuejs+webpack开发的基础开始。
我在这里创建了一个演示项目:https://github.com/Demian87/vue-test
构建良好,但启动后我收到从标题到控制台的错误,我的索引组件更改为
<!--function (a, b, c, d) { return createElement(vm, a, b, c, d, true); }-->
我正在使用 vuejs+webpack 演示项目中的 package.json。我也从那里获取了 webpack.config,但我仍然收到该错误并且没有任何效果。
关于错误原因有什么想法吗?
我注意到您的组件缺少 name
:
export default {
name: 'hello',
data: function() {
return {
greeting: 'Привет всем!'
}
}
}
我将main.js重写为
import Vue from 'vue';
import Hello from '../components/hello.vue';
new Vue({
el: '#app',
components: {
hello : Hello
}
})
此外,模板中有一个拼写错误:{{ greetings }}
而不是 {{ greeting }}
。
我正在尝试从vuejs+webpack开发的基础开始。
我在这里创建了一个演示项目:https://github.com/Demian87/vue-test
构建良好,但启动后我收到从标题到控制台的错误,我的索引组件更改为
<!--function (a, b, c, d) { return createElement(vm, a, b, c, d, true); }-->
我正在使用 vuejs+webpack 演示项目中的 package.json。我也从那里获取了 webpack.config,但我仍然收到该错误并且没有任何效果。
关于错误原因有什么想法吗?
我注意到您的组件缺少 name
:
export default {
name: 'hello',
data: function() {
return {
greeting: 'Привет всем!'
}
}
}
我将main.js重写为
import Vue from 'vue';
import Hello from '../components/hello.vue';
new Vue({
el: '#app',
components: {
hello : Hello
}
})
此外,模板中有一个拼写错误:{{ greetings }}
而不是 {{ greeting }}
。