'How to comment out a HTML tag in .Vue 's template
Recently, I'm start learning Vue and using Vue-Cli. There's a problem that I can not use hot-key(VSCode) to comment out a HTML tag in the . when I use "Ctrl+/" the line I want to comment out turns like this.
// <div> comment out this line</div>
not like this.
<!--<div> comment 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?
Solution 1:[1]
Like tony19 mentioned, installing the Vetur VSCode extension adds Vue language support, which correctly sets up comment toggling in Vue files.
Solution 2:[2]
In the template or HTML section use HTML comments
In the script, section use Javascript comments
// Comment /* Comment */
In style section use CSS comments
/* comment */
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Spooky |
| Solution 2 | BILAL ARIF |
