1、新建项目运行为空白页
解决:
</>复制代码
new Vue({
el: "#app",
})
换成
</>复制代码
new Vue({
el: "#app",
render: h => h(App)
})
2、新建项目无法运行,报错[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.(found in )
解决:build/webpack.base.conf.js
</>复制代码
resolve: {
alias: {
"vue": "vue/dist/vue.js"
}
}
3、打包后js,css样式不对
解决:config/index.js,将其中的assetsPublicPath值改为’./’
4、css中应用的资源找不到
解决:build/utils.js”,增加一行代码,publicPath因路劲而定
5、报错:Failed to mount component: template or render function not defined.found in
解决:我这里是由于我把vue文件里面的html部分和js部分多带带分开,而且取名为app.js所致,换个名字就可以了
此问题原因不单一,还有其他问题所致。详见链接描述
6、vue报错: Cannot assign to read only property "exports" of object "#