Vue启动报错: Expected indentation of xxx spaces but found xxx

刚用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


©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容