Home >Development Tools >VSCode >Introduction to how to quickly create vue file templates using VSCode

Introduction to how to quickly create vue file templates using VSCode

青灯夜游
青灯夜游forward
2020-12-29 18:45:113665browse

How to customize code template in VSCode? The following article will introduce to you VSCodeHow to quickly create a vue file template. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

Introduction to how to quickly create vue file templates using VSCode

Related recommendations: "vscode Basic Tutorial"

Modify location

Open vscode preferences-user snippets, you can search for existing file names, or create a new json file.

Create a custom template

{
"Print to console": {
"prefix": "ybase",
"body": [
"<template>",
"  <div>",
"    <!-- Page -->",
"  </div>",
"</template>",
"<script lang=\"ts\">",
"import { Vue, Component } from \"vue-property-decorator\";",
"",
"@Component({})",
"export default class NAME extends Vue {",
"  // component",
"}",
"</script>",
"<style lang=\"scss\">",
"// style",
"</style>",
""
],
"description": "YBASE"
}
}

Usage method

Above What I created is to quickly create a vue file template.
After creating a new page, you can quickly generate the page code through the configured shortcut command "ybase".

For more programming-related knowledge, please visit: Introduction to Programming! !

The above is the detailed content of Introduction to how to quickly create vue file templates using VSCode. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete