简体   繁体   English

CodeSandbox 编辑器已停止自动完成相应的 JSX 结束标记?

[英]CodeSandbox editor has stopped auto completing the corresponding JSX closing tags?

CodeSandbox editor used to auto generate the corresponding close tag for the current tag. CodeSandbox 编辑器用于为当前标签自动生成相应的关闭标签。

For example:例如:

<div> // THEN IT WOULD AUTO GENERATE THE </div> TAG

在此处输入图片说明

But don't know exactly when, it stopped doing that, and I have to write it manually.但不知道确切时间,它停止这样做了,我必须手动编写它。 Is there a way to enable this autocomplete again?有没有办法再次启用此自动完成功能?

In the codesandbox.io go to:在 codeandbox.io 中转到:

File -> Preferences -> Settings文件 -> 首选项 -> 设置

In the Search Settings box type Javascript Autoclosing Tags .搜索设置框中键入Javascript Autoclosing Tags

Enable that feature by checking the Checkbox.通过选中复选框启用该功能。

在我的情况下,如果将文件的扩展名更改为 .jsx 并且我开始键入不带 < 的标签,则自动完成工作。

Just posting an updated answer since the UI has changed for codesandbox.由于codeandbox的UI已更改,因此仅发布更新的答案。 I believe this answer is now slightly better:我相信这个答案现在稍微好一点:

  • Press cmd+, ( ctrl+, on a windows) with the editor focused (this opens the vscode settings)在编辑器聚焦的情况下按cmd+,ctrl+,在 Windows 上)(这会打开 vscode 设置)
  • You should see a settings page like so:您应该会看到如下所示的设置页面: vscode 设置的图像
  • In the Search Settings box type Javascript Autoclosing Tags在搜索设置框中键入Javascript Autoclosing Tags
  • Toggle the checkbox on打开复选框

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM