如何将HTML标签放在VS代码中的一行中?

发布于 2025-01-29 19:27:14 字数 381 浏览 2 评论 0原文

我的Mac PC中的VS代码会自动打破新行中的客户HTML标签。这使整个代码的长度更大。 例如,我希望以下一行中的代码以下代码

<FormInput name="propertyTax" width="43%" height="7%" placeholder="3,200"></FormInput>

,但VS代码如下所示。

<FormInput
name="propertyTax"
width="43%"
height="7%"
placeholder="3,200">
</FormInput>

我尝试从设置中更改Wordwrap,没有运气。

请帮我。

The VS Code in my Mac pc is automatically breaking the customer HTML tags in new lines. This is making the length of the whole code much bigger.
For example, I want below code in one line

<FormInput name="propertyTax" width="43%" height="7%" placeholder="3,200"></FormInput>

But the VS code is showing as below.

<FormInput
name="propertyTax"
width="43%"
height="7%"
placeholder="3,200">
</FormInput>

I tried change wordwrap from settings with no luck.

Please help me.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

末骤雨初歇 2025-02-05 19:27:15

只需按F1,然后输入:加入行

Just press F1, and type: join lines

乞讨 2025-02-05 19:27:15

您可以尝试关闭Vscode中的任何格式。转到代码&GT;偏好&gt;设置并搜索“格式”,然后尝试关闭“保存”格式以及您拥有的任何其他格式选项。

You can try switching off any formatters that you have in VSCOde. Go to Code > Preferences > Settings and search for "Format" and try switching off "Format on Save" and any other format option that you have.

征﹌骨岁月お 2025-02-05 19:27:15

如果您使用的是更漂亮的格式化器。转到设置并搜索以下内容:prettier.printwidth,然后从默认的80更改为300

If you're using Prettier formatter. Go to Settings and search for this: prettier.printWidth and change from default 80 to 300.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文