1. 使用cli脚手架界面化创建项目失败
错误描述
nitializing git repository…
⚓ Running completion hooks…
📄 Generating README.md…nitializing git repository…
⚓ Running completion hooks…
📄 Generating README.md…
- 浏览器界面没有报错,但项目一直在创建中
解决办法
检查安装环境:vue、vue-cli、webpack,没有的就安装好就行了
2. Failed to compile.编译失败
问题描述
1 error Expected indentation of 2 spaces but found 4 indent ✖ 1 problem (1 error, 0 warnings) 1 error and 0 warnings potentially fixable with the --fix
option.
解决办法一
安装eslint格式插件
格式化代码,设置以 eslint 标准格式化
**缺点:**不灵活,其他代码无法灵活的格式化,需要选择格式的代码再选择格式化插件整理代码
解决方法二
在项目根目录创建格式文件 .prettierrc
,在文件中配置格式化规则,常用的如下:
{
"semi": false,
"singleQuote": true
}