有个json数组,在webstorm中原本是这样显示的:
//每个元素占一行
const articles=[
{"title": "title1","content": "content1"},
{"title": "title2","content": "content2"},
{"title": "title3","content": "content3"}
];
按ctrl+alt+L
格式化显示成下面这样了:
const articles=[
{
"title": "title1",
"content": "content1"
},
{
"title": "title2",
"content": "content2"
},
{
"title": "title3",
"content": "content3"
}
];
问题:
有什么快一点的方法让它按原来那样显示?一个一个的手动调整太麻烦了。不能ctrl+z
,文件已经关闭过了。
用Notepad++替换,解决了。