【问题标题】:Is there a VSCode shortcut to wrap text in a react/react-native fragment?是否有 VSCode 快捷方式将文本包装在 react/react-native 片段中?
【发布时间】:2022-06-29 03:24:00
【问题描述】:

我发现自己经常使用片段,并希望使用键盘快捷键使其更容易。

【问题讨论】:

    标签: reactjs react-native visual-studio-code


    【解决方案1】:

    将此添加到keybindings.json

    {
        "key": "ctrl+k f", // ? whatever binding you want. obv.
        "command": "editor.action.insertSnippet",
        "when": "editorTextFocus",
        "args": {
          "snippet": "<$1>${TM_SELECTED_TEXT}</$1>"
        }
    }
    

    奖励...如果需要,光标可以输入任何其他组件的名称。

    【讨论】:

      猜你喜欢
      • 2020-03-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-20
      • 2020-09-18
      • 1970-01-01
      • 1970-01-01
      • 2016-09-24
      相关资源
      最近更新 更多