一:VSCODE 選擇 文件->首選項->設置
二:搜索 vetur.format.defaultFormatterOptions
三:點擊settings.json
四:添加如下設置
"vetur.format.defaultFormatterOptions": { "js-beautify-html": {
"wrap_line_length": 900, // 數值越大,一行放的屬性越多
"wrap_attributes": "auto",
"end_with_newline": false
}, "prettyhtml": { "printWidth": 100, "singleQuote": false, "wrapAttributes": false, "sortAttributes": false } }, "vetur.format.defaultFormatter.html": "js-beautify-html", "vetur.format.defaultFormatter.js": "vscode-typescript",
五:保存即可