当前位置:网站首页>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
边栏推荐
- Currently clicked button and current mouse coordinates in QT judgment interface
- 2022-5-第四周日报
- Chart. JS - Format Y axis - chart js - Formatting Y axis
- 7.Oracle-表结构
- 阿里新成员「瓴羊」正式亮相,由阿里副总裁朋新宇带队,集结多个核心部门技术团队
- MySQL advanced part 1: View
- Knapsack problem acwing 9 Group knapsack problem
- 4. 对象映射 - Mapping.Mapster
- 【LeetCode】Easy | 20. Valid parentheses
- Game theory acwing 893 Set Nim game
猜你喜欢
Bash exercise 17 writing scripts to install the server side of FRP reverse proxy software
求组合数 AcWing 889. 满足条件的01序列
1.手动创建Oracle数据库
LeetCode-54
MySQL advanced part 2: optimizing SQL steps
20220213-CTF MISC-a_ good_ Idea (use of stegsolve tool) -2017_ Dating_ in_ Singapore
TCP's understanding of three handshakes and four waves
2021apmcm post game Summary - edge detection
WordPress switches the page, and the domain name changes back to the IP address
Simple selection sort of selection sort
随机推荐
Find the combination number acwing 887 Find combination number III
论文阅读报告
Regulations for network security events of vocational group in 2022 Guizhou Vocational College skill competition
Game theory acwing 891 Nim games
Game theory acwing 894 Split Nim game
微信小程序路由再次跳转不触发onload
P2575 master fight
Ffmpeg build download (including old version)
2021apmcm post game Summary - edge detection
What is socket? Basic introduction to socket
容斥原理 AcWing 890. 能被整除的数
Chinese remainder theorem acwing 204 Strange way of expressing integers
ollvm编译出现的问题纪录
Redis-01.初识Redis
__ builtin_ Popcount() counts the number of 1s, which are commonly used in bit operations
Winter vacation water test 1 Summary
C job interview - casting and comparing - C job interview - casting and comparing
求组合数 AcWing 887. 求组合数 III
1.13 - RISC/CISC
Leetcode-6108: decrypt messages