如何在VSCode中自动缩进jsx [英] How to auto indent jsx in VSCode
本文介绍了如何在VSCode中自动缩进jsx的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
VSCode似乎不会在jsx中自动缩进HTML元素?
VSCode seems doesn't auto indent HTML elements in jsx?
有什么办法可以解决它.
Is there any way to fix it.
更新:
在 Atom 中:
当我输入<div>
时,原子将显示:
When I input <div>
, atom will show:
按return
键后,结果为(注意光标的位置):
After I press the return
key, the result is(pay attention to the location of the cursor):
在 VSCode 中:
推荐答案
尝试将语言模式更改为JavaScript React.
Try changing the language mode to JavaScript React.
- 打开命令面板.
- 键入
change language mode
- 按 Enter
- 键入
javascript react
- 按 Enter
- Open the commands palette.
- Type
change language mode
- Press Enter
- Type
javascript react
- Press Enter
完成后,您将在左下角看到JavaScript React模式.
Once that's done, you'll see the JavaScript React mode in the bottom left corner.
一旦处于该模式,请再次尝试格式化文档.
Once you're in that mode, try again to format the document.
这篇关于如何在VSCode中自动缩进jsx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文