步骤
- 点击导航的文件 ->首选项->用户代码片段
- 点击新建代码片段,并输入jsx.json
- 创建成功后把下面的代码段复制进去
- 在jsx文件中输入jsx并按下tab键即可补全代码
{
“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”
}
}