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.
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!