![](/img/trans.png)
[英]VSCODE : Disable HTML Auto Closing Tags only for Javascript files
[英]prettier - disable auto closing of html tags
如何禁用/避免更漂亮地在格式化時自動關閉 HTML 標簽? 我在 vs 代碼 settings.json 中嘗試了"html.autoClosingTags": false
,但它不起作用。
格式化前:
<body>
<h1>home page</h1>
格式化后:
<body>
<h1>home page</h1>
</body>
在您的 JSX 中,您需要的代碼是:
{
"javascript.autoClosingTags": false,
"typescript.autoClosingTags": false
}
為了您的標簽不會自動關閉。 您還可以在每個版本 16.11 的首選項中進行調整。
轉到文件 > 首選項 > 設置,搜索 html。 autoClosingTags 並將其設置為 false 。 這將使您在鍵入時不會自動插入,但是如果您開始鍵入 </ ,它不會自動關閉標簽。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.