简体   繁体   English

VSCODE:仅对 Javascript 文件禁用 HTML 自动关闭标签

[英]VSCODE : Disable HTML Auto Closing Tags only for Javascript files

I'm using VSCODE to program my web apps using JQuery and when I want to work with divs and for example when I want to make a new div in JQuery, I write :我正在使用 VSCODE 使用 JQuery 对我的 Web 应用程序进行编程,当我想使用 div 时,例如当我想在 JQuery 中创建一个新的 div 时,我会这样写:

$('<div>

But VSCODE close instantly this html tag like this:但是 VSCODE 会像这样立即关闭这个 html 标签:

$('<div></div>

What i'd like is to keep this html closing tag in other languages, but disabling it on .js files.我想要的是在其他语言中保留此 html 结束标记,但在 .js 文件中禁用它。 Is it possible using VSCODE ?是否可以使用 VSCODE ?

If you are using the extension "Auto Close Tag" this will do the Job:如果您使用扩展“自动关闭标签”,这将完成以下工作:

    {
    "auto-close-tag.activationOnLanguage": [
        "html",
        "xml"

    ]
}

Put this in your VSCODE settings.json把它放在你的 VSCODE settings.json 中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM