WebStorm一键创建箭头函数

2,836 阅读1分钟

前言

教程所示为mac系统,windows也类似

设置方式

  1. 打开perferences(windows中为setting)

在搜索框中输入live,找到Live Templates

image.png

  1. 右侧找到JavaScript标签,展开后点击+号,按照图示添加(af 为arrow function简写,可以设置自己喜欢的)。

注意在Apllicable中选择Everywhere

image.png 3. 点击Apply查看效果

image.png

选择后将会进行自动填充,同时将光标默认放置在中间。

image.png

以上。