打开文件=>首选项=>设置
点开setting.json
添加如下内容
"eslint.validate": [ "javascript", "javascriptreact", { "language": "vue", "autoFix": true }, "vue" ], "eslint.autoFixOnSave": true
保存然后重启vscode