reactjs - 为什么 React 组件代码不会自动缩进?
问题描述
我正在使用带有 React 的 Visual Studio Code。但是代码缩进不会自动应用 - 我必须手动执行它。似乎使用文本编辑器。
示例代码:
<Toolbar tabbar bottom slot="fixed">
<Link bgColor="primary" textColor="white" onClick={() => AcceptOrder(self, order)}>
<strong>
{RootScope.t['Accept order']}
</strong>
</Link>
</Toolbar>
我正在使用 ES7 React/Redux/GrapQL 扩展。
解决方案
你使用任何Prettier
规则吗?
此外,vscode 中的默认代码格式化快捷方式Shift+Alt+F
可以在https://code.visualstudio.com/docs/getstarted/keybindings中查看
推荐阅读
- python-3.x - 在 deeplab 中运行测试文本“local_test.sh”时出现问题。但 modle_test.py 工作正常
- r - r中的ggplot中的双y轴(条形和线形)
- c# - 事件选项卡未显示在诊断工具 VS 2017 中
- python-2.7 - 为什么 2.0 不能满足要求?
- flutter - 如何更改颤动应用程序键盘颜色?
- xcode11 - Swift Package Manager 与哪些 iOS 版本兼容?
- jquery - 如何为特定组件加载 slick-carousel 文件
- javascript - 如何在javascript中控制图像
- mergesort - 在 python 中实现合并排序时得到了错误的答案
- python - AttributeError:模块“张量板”没有属性“懒惰”