当我格式化 HTML 文件时,VS Code 会堆叠元素属性。有什么办法可以禁用它吗?
问问题
8297 次
3 回答
9
对此的默认设置是:
"html.format.wrapAttributes": "auto"
有"auto"
含义:
仅当超过行长度时才换行属性。
行长在不同的设置中定义,默认为120
:
// Maximum amount of characters per line (0 = disable).
"html.format.wrapLineLength": 120
所以设置"html.format.wrapLineLength"
应该0
会给你想要的行为。
于 2017-02-07T20:26:44.220 回答
4
这对我有用。在您的“Settings.json”文件中添加该行
"prettier.printWidth": 300
于 2020-09-07T04:43:28.307 回答