vscode格式化标签属性不换行
2022-05-20 本文已影响0人
依然_8deb
一、打开“文件”->“首选项”->“设置”,在[搜索框]中搜索:
vetur.format.defaultFormatter.html
将这一项Default Formatter: HTML设置成“js-beautify-html”。

二、然后打开右上角的json配置文件,如图:

在setting.json中添加以下代码:
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
"wrap_attributes": "auto"
},
"prettyhtml": {
"printWidth": 100,
"singleQuote": false,
"wrapAttributes": false,
"sortAttributes": false
}
},