当前位置:网站首页>Vscode creates its own code template
Vscode creates its own code template
2022-07-05 06:27:00 【Heerey525】
situation
I'll go back to react, Write jsx There's a bit more code , Each time you create a new component, you need to type it by hand or copy A template , It's inconvenient , Plan to match a set of templates , After that, you can use the shortcut key to directly generate .
Creating steps
1. The entrance opens
In one word :( top left corner ) file - Preferences - User code snippets
Entrance two : Here's the picture
2. New code snippet
In order not to affect other code fragments , We choose New global code fragment file
Fill in the file name you want to create , I intend to create jsx Code snippet of , So it was named jsx, Then click save
The default is to take the example
3. Write the configuration
prefix: Shortcut key
body: Code snippet for configuration \t Indent with space \n Refers to line feed
description: Description of code snippets
This is the code. , You can also refer to , Configure a set of vue The template of
{
"jsx_template": {
"prefix": "jsx",
"body": [
"import React, { Component } from 'react';\n",
"export default class xx extends Component {",
"\trender() {",
"\t\treturn <div>xx</div>;",
"\t}",
"}"
],
"description": "jsx The template of "
}
}
4. Use
Direct input jsx, enter
Reference material :vsCode Create your own code template
边栏推荐
- Basic explanation of typescript
- Game theory acwing 893 Set Nim game
- MySQL怎么运行的系列(八)14张图说明白MySQL事务原子性和undo日志原理
- Network security skills competition in Secondary Vocational Schools -- a tutorial article on middleware penetration testing in Guangxi regional competition
- Stack acwing 3302 Expression evaluation
- Leetcode-6108: decrypt messages
- Ffmpeg build download (including old version)
- Sorting out the latest Android interview points in 2022 to help you easily win the offer - attached is the summary of Android intermediate and advanced interview questions in 2022
- How to understand the definition of sequence limit?
- 求组合数 AcWing 889. 满足条件的01序列
猜你喜欢
AE tutorial - path growth animation
Client use of Argo CD installation
MySQL advanced part 1: index
博弈论 AcWing 891. Nim游戏
Gaussian elimination acwing 884 Gauss elimination for solving XOR linear equations
【高德地图POI踩坑】AMap.PlaceSearch无法使用
求组合数 AcWing 889. 满足条件的01序列
NotImplementedError: Cannot convert a symbolic Tensor (yolo_boxes_0/meshgrid/Size_1:0) to a numpy ar
5.Oracle-表空间
[QT] QT multithreading development qthread
随机推荐
阿里巴巴成立企业数智服务公司“瓴羊”,聚焦企业数字化增长
5. Oracle TABLESPACE
P2575 master fight
Bash exercise 17 writing scripts to install the server side of FRP reverse proxy software
20220213-CTF MISC-a_ good_ Idea (use of stegsolve tool) -2017_ Dating_ in_ Singapore
【LeetCode】Easy | 20. Valid parentheses
Leetcode dynamic programming
Leetcode-22: bracket generation
[learning] database: several cases of index failure
1.15 - input and output system
Sum of three terms (construction)
2022-5-第四周日报
Leetcode-9: palindromes
在新线程中使用Handler
Bit of MySQL_ OR、BIT_ Count function
MySQL怎么运行的系列(八)14张图说明白MySQL事务原子性和undo日志原理
Chinese remainder theorem acwing 204 Strange way of expressing integers
1.14 - assembly line
Stack acwing 3302 Expression evaluation
International Open Source firmware Foundation (osff) organization