您的位置:首页 > 产品设计 > UI/UE

Vue.js之构建项目初始步骤(二)

2018-03-06 11:30 603 查看

接上回:

http://blog.csdn.net/qq_33733970/article/details/79441889

报错解决:

This dependency was not found:

* common/stylus/index.styl in ./src/main.js


解决方案:

在这个路径文件夹下:D:\Django\Vue_Project\vue-music\build\webpack.base.conf.js:

resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'@': resolve('src'),#所以当前路径不能用./代替
// 'common':resolve('src/common')
}
},


在main.js文件中:

import 'common/stylus/index.styl'


当然首先要把stylus还有stylus-loader安装一下,就没有问题了。

解决问题时,前后端报错都要看一下,要不然会浪费很多时间!

http://eslint.org/docs/rules/no-multiple-empty-lines Too many blank lines at the end of file. Max of 0 allowed

这种错误解决:

https://www.jianshu.com/p/1682b91756b1

在 .eslintrc.js文件中:

rules: {
// allow async-await
'generator-star-spacing': 'off',
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
"no-multiple-empty-lines": [1, {"max": 2}],//空行最多不能超过2行
}


这样报错消失!

完事开头难,这样就开搞啦~

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Vue.js