1、初始化vue项目,报错This is probably not a problem with npm,there is likely additional logging output above
原因:版本原因,更新一下
解决方案:
npm install之后,运行 npm i -D webpack-dev-server@2.9.7
2、引入fontAwson打包完后路径问题
解决方案:在build》utils.js加上图中那一段代码 publicPath:'../../'
3、打包问题注意事项
npm run build之前要在config >index.js中将assetsPublicPath: '/',里面的/删除
页面#不能丢
4、首页显示问题
如果想在页面首页显示第一页,在mian里面加入redirect: 'home'
5、Failed to mount component: template or render function not defined.
页面没有内容
6、报错
/node_modules/css-loader?{"sourceMap":true}!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-28c15856","scoped":true,"hasInlineConfig":false}!./node_modules/stylus-loader?{"sourceMap":true}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/components/singer-detail/singer-detail.vue
Module build failed: ParseError: D:\music\vue-music\src\components\singer-detail\singer-detail.vue:22:1
18| .slide-enter-active, .slide-leave-active
19| transition: all 0.3s
20| .slide-enter, .slide-leave-to
21| transform: translate3d(100%, 0, 0)
22|
-------^
expected "indent", got "eos"
原因:css格式不对,因为我用的stylus,所以css代码格式不对会报这个错