JSX or HTML autocompletion in Visual Studio Code

前端 未结 16 1171
说谎
说谎 2020-12-12 10:14

Is there any way to use components or HTML completion in Visual Studio Code? Because typing each letter manually is not good idea when we have classes like Bootstrap etc. Fo

16条回答
  •  天涯浪人
    2020-12-12 11:06

    2019: Straight-to-the-point answer for React

    The most straight-forward way to get JSX/HTML autocomplete in your React projects is to add this to your user settings or workspace settings (/.vscode/settings.json):

          "emmet.includeLanguages": {
            "javascript": "javascriptreact"
          },
          "emmet.triggerExpansionOnTab": true
    

    You may have to restart VS Code for the change to take effect.

    P.S. If you're not doing this mapping for a React.js project, then KehkashanFazal's answer should probably work for you.

提交回复
热议问题