安装插件ESLint
文件 — 首选项 — 设置 — 在settings.json 中添加以下代码即可
可能会出现没效果现象 升级vscode
"editor.codeActionsOnSave": {
"source.fixAll": true
},
或者 在项目中创建 vue.config.js 通过关闭eslint 完成项目后 在命令输入 npm run lint 来修正代码格式不规范
关闭eslint
module.exports = { lintOnSave: false }