美文网首页IT全栈大杂烩
Vue启动报错: Expected indentation of

Vue启动报错: Expected indentation of

作者: 落雨尘 | 来源:发表于2019-10-29 15:44 被阅读0次

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

相关文章

网友评论

    本文标题:Vue启动报错: Expected indentation of

    本文链接:https://www.haomeiwen.com/subject/fxkgvctx.html