在有安装eslint和vetur下,Vue格式化错误
在vscode中 ctrl+shift+p在命令面板中输入settings.json后输入代码
{
// 保存文件时eslint 格式化 js代码
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
},
// 保存文件时,格式化工具vetur自动格式化代码格式
"editor.formatOnType": true,
"editor.formatOnSave": true,
// 对于javascript代码,关闭prettier,交给eslint fix。如果有其他工具也需要关闭
"vetur.format.defaultFormatter.js": "none",
"vetur.format.defaultFormatter.ts": "none",
}