简体   繁体   English

WebStorm:将直接返回箭头功能转换为多行箭头功能

[英]WebStorm: Converting direct-return arrow function into multi-line arrow function

Is an automatic conversion of the following kind possible? 是否可以进行以下自动转换?

const cuteLittleFunction = input=>value;

to: 至:

const cuteLittleFunction = input=> {
   return value;
};

I find myself doing this a lot, and it gets pretty annoying. 我发现自己经常这样做,这很烦人。

Put cursor on input , hit Alt+Enter , choose Add braces to arrow function statement : 将光标放在inputAlt+Enter ,选择“ 将大括号添加到箭头函数”语句

在此处输入图片说明

Code will be changed to 代码将更改为

const cuteLittleFunction = input => {
    return value;
};

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM