管理->设置->扩展->Vetur
{
"workbench.colorTheme": "Monokai",
"editor.fontSize": 14,
"editor.lineHeight": 16,
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"files.hotExit": "onExit",
"editor.formatOnPaste": true,
"editor.multiCursorModifier": "ctrlCmd",
"editor.snippetSuggestions": "top",
"[vue]": {
"editor.defaultFormatter": "octref.vetur"
},
"explorer.confirmDelete": false,
"vetur.completion.scaffoldSnippetSources": {},
"vetur.format.defaultFormatter.html": "js-beautify-html", // html 不换行
"vetur.format.defaultFormatter.js": "vscode-typescript", // js 不换行
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
"wrap_line_length": 0, // 设置多个字符后换行 0 表示忽略
"wrap_attributes": "auto", // html 标签属性 换行设置[auto|force|force-aligned|force-expand-multiline] ["auto"]
"end_with_newline": false // 在文件结尾添加新行
},
"prettyhtml": {
"singleQuote": false,
"wrapAttributes": false,
"sortAttributes": false
}
},
}
来源:oschina
链接:https://my.oschina.net/lantianbaiyun/blog/3274887