Vue Cli 设置缩进为4个空格

前言

对于一个习惯了缩进是四个空格的人来说,突然缩进编程了两个空格,觉得寝食难安。

所以这里提供了一种在WebStorm中,将Vue CLI 项目缩进调整为四个空格的方法

解决方法

  1. 新建一个.editorconfig的文件

  2. 在其中写入如下的代码

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    root = true

    [*]
    charset = utf-8
    indent_style = space
    # 这里的值改成4,缩进就能编程4个空格
    indent_size = 4
    end_of_line = lf
    insert_final_newline = true
    trim_trailing_whitespace = true