关闭>新行

问题描述 投票:1回答:2

我在标签中遇到'>'问题。我有:

<label
    class="custom-control-label"
    for="building{{building.Id}}"
>
 {{ building.City }}, {{ building.Name }}
</label>

如何使标签开始标记'>'与上一个属性在同一行?我使用Prettier,但我既没有在配置中也没有在代码设置中找到解决方案。

<label
   class="custom-control-label"
   for="building{{building.Id}}">
     {{ building.City }}, {{ building.Name }}
</label>

解决方案:我使用了内置的VS Code格式化程序。

visual-studio-code prettier
2个回答
3
投票

更漂亮的设置称为jsxBracketSameLine,需要设置为true

Documentation

https://prettier.io/docs/en/options.html#jsx-brackets


1
投票

你可以关注this线程。

这是Prettier的功能请求。

© www.soinside.com 2019 - 2024. All rights reserved.