【问题标题】:Why React components code doesn't get auto indented?为什么 React 组件代码不会自动缩进?
【发布时间】:2019-10-18 12:07:25
【问题描述】:

我正在使用带有 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 扩展。

【问题讨论】:

    标签: reactjs visual-studio-code indentation


    【解决方案1】:

    您使用任何Prettier 规则吗?

    另外,vscode 中的默认代码格式化快捷方式是 Shift+Alt+F,您可以查看 https://code.visualstudio.com/docs/getstarted/keybindings

    【讨论】:

      猜你喜欢
      • 2012-05-16
      • 1970-01-01
      • 1970-01-01
      • 2019-11-17
      • 1970-01-01
      • 1970-01-01
      • 2022-01-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多