用vue手脚架生成的项目修.vue文件后,保存编译报错,缺少2个空格

来源:互联网 发布:centos 7 乱码 编辑:程序博客网 时间:2024/05/06 07:10

报错如下:

ERROR in ./src/App.vue  

http://eslint.org/docs/rules/indent Expected indentation of 2 spaces but found 1  

E:\myapp\myproject\src\App.vue:11:2  

data () { 

^

✘ 1 problem (1 error, 0 warnings)Errors:  

1http://eslint.org/docs/rules/indent

@ ./src/main.js 3:0-24 

@ multi ./build/dev-client ./src/main.js


分析:

这样是因为初始化项目的时候Use ESLint to lint your code? (Y/n) 这一步选了y,设置了eslint,

如果不想有规范的js代码,可以重新初始化关掉eslint。Use ESLint to lint your code? (Y/n) 这一步选no

如果想有良好的规范,其实错误已经很清晰,大多数就是缩进不规范,分号不需要等原因,很容易解决的。写多了就成习惯了。



0 0