当前位置:网站首页>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
边栏推荐
- 1.手动创建Oracle数据库
- One question per day 1020 Number of enclaves
- [QT] QT multithreading development qthread
- Leetcode-22: bracket generation
- Leetcode stack related
- Find the combination number acwing 888 Find the combination number IV
- Design specification for mobile folding screen
- Ffmpeg build download (including old version)
- Game theory acwing 893 Set Nim game
- vsCode创建自己的代码模板
猜你喜欢
ollvm编译出现的问题纪录
MySQL advanced part 2: storage engine
Gauss Cancellation acwing 884. Solution d'un système d'équations Xor linéaires par élimination gaussienne
Vant Weapp SwipeCell设置多个按钮
Client use of Argo CD installation
【高德地图POI踩坑】AMap.PlaceSearch无法使用
[2020]GRAF: Generative Radiance Fields for 3D-Aware Image Synthesis
20220213-CTF MISC-a_ good_ Idea (use of stegsolve tool) -2017_ Dating_ in_ Singapore
[moviepy] unable to find a solution for exe
Day 2 document
随机推荐
Leetcode-22: bracket generation
Day 2 document
Leetcode stack related
Bit of MySQL_ OR、BIT_ Count function
MySQL advanced part 1: triggers
什么是套接字?Socket基本介绍
Client use of Argo CD installation
Leetcode array operation
[leetcode] day95 effective Sudoku & matrix zeroing
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
Leetcode backtracking method
Leetcode-9: palindromes
__ builtin_ Popcount() counts the number of 1s, which are commonly used in bit operations
[wustctf2020] plain_ WP
Leetcode-6109: number of people who know secrets
Traversal of leetcode tree
LeetCode-61
7.Oracle-表结构
NotImplementedError: Cannot convert a symbolic Tensor (yolo_boxes_0/meshgrid/Size_1:0) to a numpy ar
【LeetCode】Day95-有效的数独&矩阵置零