当前位置:网站首页>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
边栏推荐
- 4. 对象映射 - Mapping.Mapster
- 2022-5-第四周日报
- Design specification for mobile folding screen
- Winter vacation water test 1 Summary
- There are three kinds of SQL connections: internal connection, external connection and cross connection
- What's wrong with this paragraph that doesn't work? (unresolved)
- Redis-02.Redis命令
- FFmpeg build下载(包含old version)
- Client use of Argo CD installation
- C - XOR to all (binary topic)
猜你喜欢
随机推荐
11-gorm-v2-03-basic query
Record the process of configuring nccl and horovod in these two days (original)
Ffmpeg build download (including old version)
WordPress switches the page, and the domain name changes back to the IP address
什么是套接字?Socket基本介绍
Vant Weapp SwipeCell设置多个按钮
博弈论 AcWing 894. 拆分-Nim游戏
将webApp或者H5页面打包成App
How to make water ripple effect? This wave of water ripple effect pulls full of retro feeling
Leetcode-1200: minimum absolute difference
Gauss Cancellation acwing 884. Solution d'un système d'équations Xor linéaires par élimination gaussienne
[moviepy] unable to find a solution for exe
Chapter 6 relational database theory
高斯消元 AcWing 884. 高斯消元解异或線性方程組
June 29, 2022 daily
3. Oracle control file management
[learning] database: MySQL query conditions have functions that lead to index failure. Establish functional indexes
Inclusion exclusion principle acwing 890 Divisible number
1.13 - RISC/CISC
2022-5-第四周日报