1、首先,点击左上角的file菜单
2、弹出了下拉菜单选择为settings选项
3、点击左侧中的prettier选项
4、勾选on code reformat选项
5、勾选on code reformat选项之后,点击ok