vscode generates react's jsx code snippet

step

  1. Click on the navigation file-> Preferences-> User code snippet
  2. Click New Code Snippet and enter jsx.json
  3. After the creation is successful, copy the following code segment into it
  4. Enter jsx in the jsx file and press the tab key to complete the code
    {
    "jsx": {
    "prefix": "jsx",
    "body": [
    "import React from 'react'",
    "",
    "export default class $ 1 extends React.Component {",
    " ",
    " \ tconstructor () {",
    " \ t \ tsuper () ",
    " \ t} ",
    " ",
    " \ trender () {",
    " \ t \ treturn (",
    " \ t \ t \ t
    ”,
    “\t\t)”,
    “\t}”,
    “”,
    “}”
    ],
    “description”: “jsx components”
    }
    }
Published 5 original articles · Likes5 · Visits 118

Guess you like

Origin blog.csdn.net/qq_37061326/article/details/105525867
Recommended