How does VSCode quickly generate custom templates? This article will introduce to you how to configure and generate custom templates in VSCode.
1. Install VSCode
Download address: https://code.visualstudio.com/
Start vsCode after the installation is complete, omitting 10,000 words here.... [Recommended learning: "vscode tutorial"]
2 . Call up the VSCode console
Windows shortcut key: Ctrl Shift P
macOS shortcut key: command Shift P
3. Enter "snippets" and select
## 4. There are many code snippets for custom writing as follows
5. We use vue files for demonstration (input vue) Select vue.json
6. vsCode automatically generates the vue.json file as follows
7. Change the vue.json file to the following configuration (the template content can be modified according to personal needs)
{ "Print to console": { "prefix": "vue", "body": [ "<template>", " <div></div>", "</template>", "", "<script>", "export default {", " components: {},", " props: {},", " data() {", " return {", " };", " },", " watch: {},", " computed: {},", " methods: {},", " created() {},", " mounted() {}", "};", "</script>", "<style lang=\"scss\" scoped>", "</style>" ], "description": "A vue file template" } }
8. Create a new vue file in the project, enter "vue" and press the Enter key or the Tab key, the template will be automatically generated
Original address: https://juejin.cn/post/6974605121942454280More programming For related knowledge, please visit:Author: Sanzhu Technical Team
Introduction to Programming! !
The above is the detailed content of A brief discussion on how to configure and generate custom templates in VSCode. For more information, please follow other related articles on the PHP Chinese website!