一、新建项目运行为空白页
解决:css
new Vue({ el: '#app', })
换成html
new Vue({ el: '#app', render: h => h(App) })
二、新建项目没法运行,报错[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.jsvue
resolve: { alias: { 'vue': 'vue/dist/vue.js' } }
三、打包后js,css样式不对
解决:config/index.js,将其中的assetsPublicPath值改成’./’webpack
四、css中应用的资源找不到
解决:build/utils.js”,增长一行代码,publicPath因路劲而定 web
五、报错:Failed to mount component: template or render function not defined.found in
解决:我这里是因为我把vue文件里面的html部分和js部分单独分开,并且取名为app.js所致,换个名字就能够了
此问题缘由不单一,还有其余问题所致。详见连接描述segmentfault
六、vue报错: Cannot assign to read only property 'exports' of object '#<Object>'
解决app