刚用vuecli搭好的工程,启动的时候报了一堆的错误:
⚠ http://eslint.org/docs/rules/indent Expected indentation of 4 spaces but found 6
src\components\Login.vue:22:1
login () {
^
⚠ http://eslint.org/docs/rules/indent Expected indentation of 6 spaces but found 8
src\components\Login.vue:23:1
this.$axios
^
⚠ http://eslint.org/docs/rules/indent Expected indentation of 4 spaces but found 6
src\components\Login.vue:36:1
}
^
⚠ http://eslint.org/docs/rules/indent Expected indentation of 2 spaces but found 4
src\components\Login.vue:37:1
}
^
⚠ http://eslint.org/docs/rules/indent Expected indentation of 0 spaces but found 2
src\components\Login.vue:38:1
}
问题大致一样,是vuecli对空格检查的问题,解决方法如下:
1、在工程根目录下找到.eslintrc.js
2、在rules标签中添加 'indent': 'off'
3、重启项目npm run dev
网友评论