webstorm设置模板和设置缩进长度

1、设置缩进长度

进入File->setting->Editor->Code Style进行设置

如下图(这里我设置成两个空格):
webstorm设置模板和设置缩进长度

2、设置模板

进入ile->setting->Editor->Live Templates

1、在里面找到Vue,如下图:
webstorm设置模板和设置缩进长度
2、点击添加(也就是右边的‘+’号),选择【1.Live Template】,如下图
webstorm设置模板和设置缩进长度
3、在新页签中填入模板内容,如下图所示:
webstorm设置模板和设置缩进长度
4、选择模板应用的具体语言,如下图所示:
webstorm设置模板和设置缩进长度
我使用的是html所以就选择了html
webstorm设置模板和设置缩进长度
5、选择完之后就点击OK,然后就可以进行使用了