您好:
在vs code中,以html為例
<div id="app">
<div>
<counter7 v-for="ct in counters" :title="ct.title" :plus-btn-name="ct.plusBtnName" :minus-btn-name="ct.minusBtnName">
</counter7>
</div>
</div>
只要存檔,他就會變成一行
但有時候,想要讓他保持多行
<div id="app">
<div>
<counter7 v-for="ct in counters"
:title="ct.title"
:plus-btn-name="ct.plusBtnName"
:minus-btn-name="ct.minusBtnName">
</counter7>
</div>
</div>
這樣有辦法做到嗎?
直接貼我的設定給你好了,你自己研究
我倒是沒有遇到這麼長還會變成一行
{
"html.format.wrapAttributes": "preserve",
"html.format.wrapLineLength": 0,
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
"[vue]": {
"editor.defaultFormatter": "octref.vetur"
},
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
"wrap_attributes": "force-expand-multiline",
},
"prettyhtml": {
"printWidth": 100,
"singleQuote": false,
"wrapAttributes": false,
"sortAttributes": false
},
"prettier": {
"singleQuote": true,
"trailingComma": "all"
}
}
}