首先確保VS Code 安裝了 Vetur 和 Eslint 插件。
VS CODE :文件 =>首選項 => 設置 (有3個點 或 {} 這樣的大括號,打開setting.json)
{ "eslint.validate": [ "javascript", "javascriptreact", { "language": "vue", "autoFix": true }, { "language": "html", "autoFix": true } ], "vetur.format.defaultFormatter.html": "js-beautify-html", "eslint.autoFixOnSave": true, "explorer.confirmDelete": false, "editor.tabSize": 2, "window.zoomLevel": 0, "vetur.format.defaultFormatterOptions": { "js-beautify-html": { "wrap_line_length": 120, "wrap_attributes": "auto", "end_with_newline": false } } }
...
詳解移步到:https://blog.csdn.net/u013304372/article/details/78927570
