- 安装 vetur Prettier - Code formatter Beautify 三种插件
- 直接上图
3.
//在settings.json写
{
"editor.codeActionsOnSave": null,
"workbench.colorTheme": "Solarized Dark",
"workbench.iconTheme": "vscode-icons",
"vetur.format.options.tabSize": 4,
"[vue]": {
"editor.defaultFormatter": "octref.vetur"
},
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
"wrap_attributes": "auto"
},
"prettier": {
"semi": false,
"singleQuote": true
}
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"vetur.format.defaultFormatter.html": "js-beautify-html",
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}