Home > Development Tools > VSCode > body text

A brief discussion on how to configure and generate custom templates in VSCode

青灯夜游
Release: 2021-08-03 19:36:04
forward
4457 people have browsed it

How does VSCode quickly generate custom templates? This article will introduce to you how to configure and generate custom templates in VSCode.

A brief discussion on 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

A brief discussion on how to configure and generate custom templates in VSCode

3. Enter "snippets" and select

A brief discussion on how to configure and generate custom templates in VSCode

## 4. There are many code snippets for custom writing as follows

A brief discussion on how to configure and generate custom templates in VSCode

5. We use vue files for demonstration (input vue) Select vue.json

A brief discussion on how to configure and generate custom templates in VSCode

6. vsCode automatically generates the vue.json file as follows

A brief discussion on how to configure and generate custom templates in VSCode

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"
}
}
Copy after login

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

A brief discussion on how to configure and generate custom templates in VSCode

Original address: https://juejin.cn/post/6974605121942454280


Author: Sanzhu Technical Team

More programming For related knowledge, please visit:

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!

Related labels:
source:掘金--三猪技术团队
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template