1、首先在code中安装 Prettier -Code formatter[代码格式化程序]
2、第二步在菜单栏中打开设置
4、第四步添加一条保存时格式化代码的语句"editor.formatOnSave": true