如何在 VSCode 的 .js 文件中注释 JSX 代码? [英] How to comment JSX code out in .js files in VSCode?
本文介绍了如何在 VSCode 的 .js 文件中注释 JSX 代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
与 webstorm 不同,我无法在 Visual Studio Code 的 .js
文件中注释 JSX 代码.
解决方案
可以通过{/**/}注释掉JSX
示例:
render() {返回 (<div><组件1/>{/* <组件2/>*/}
)}
然后Component2将被注释掉
Unlike in webstorm, I'm unable to comment JSX code out in .js
files in the Visual Studio Code.
解决方案
You can comment out JSX by {/**/}
Example :
render() {
return (
<div>
<Component1 />
{/* <Component2 /> */}
</div>
)
}
and then Component2 would be commented out
这篇关于如何在 VSCode 的 .js 文件中注释 JSX 代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文