admin管理员组文章数量:1287253
Recently, I'm start learning Vue and using Vue-Cli. There's a problem that I can not use hot-key(VSCode) to ment out a HTML tag in the . when I use "Ctrl+/" the line I want to ment out turns like this.
// <div> ment out this line</div>
not like this.
<!--<div> ment out this line</div>-->
Is there any possibility that I changed some setting in the VSCode to result this situation? Anyone know how to solve this problem?
Recently, I'm start learning Vue and using Vue-Cli. There's a problem that I can not use hot-key(VSCode) to ment out a HTML tag in the . when I use "Ctrl+/" the line I want to ment out turns like this.
// <div> ment out this line</div>
not like this.
<!--<div> ment out this line</div>-->
Is there any possibility that I changed some setting in the VSCode to result this situation? Anyone know how to solve this problem?
Share Improve this question asked Aug 9, 2020 at 3:18 RayRay 3201 gold badge3 silver badges7 bronze badges 03 Answers
Reset to default 7Like tony19 mentioned, installing the Vetur VSCode extension adds Vue language support, which correctly sets up ment toggling in Vue files.
In the template or HTML section use HTML ments
In the script, section use Javascript ments
// Comment /* Comment */
In style section use CSS ments
/* ment */
For single line ment use Ctrl + /. This will do something like this
// <div> ment out this line</div>
and for block ment use Ctrl + Shift + /. This will ment lines like this
<!-- <div> ment out this line</div>
<div> ment out this line</div>
<div> ment out this line</div> -->
or
/* <div> ment out this line</div>
<div> ment out this line</div>
<div> ment out this line</div> */
In order to change shortcut key
Windows: File > Preferences > Keyboard Shortcuts.
MacOS: Code > Preferences > Keyboard Shortcuts.
and then search for ment like this Screenshot
本文标签: javascriptHow to comment out a HTML tag in Vue 39s templateStack Overflow
版权声明:本文标题:javascript - How to comment out a HTML tag in .Vue 's template - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741255504a2366594.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论