Implementation of vscode custom vue template

Implementation of vscode custom vue template

Use the vscode editor to create a vue template, so you no longer have to repeat certain code snippets every time you create a new vue file. Enter vue and press Enter to generate customized vue file content. It is very easy to use and greatly improves development efficiency.

Open vscode and select File > Preferences > User Snippets. Then enter vue in the input box that appears and press Enter. A file called vue.json is opened. As shown in the figure:

The corresponding template content has been added to the image content. To explain, the prefix field represents the custom instruction, which is the vue tag we enter in the vue file. Press Enter to generate the custom file content; the body contains our custom content. \t is a tab character, I mainly use it for formatting code

After creating the vue template, you can create files through vue! As shown below:

Code content:

 "Print to console": {
 "prefix": "vue",
 "body": [
 "<!-- $0 -->",
 "<template>",
  "\t<div>",
  "",
  "\t</div>",
 "</template>",
 "",
 "<script>",
 "export default {",
    "\tname: '',",
 "\tcomponents: {},",
 "\tdata () {",
 "\treturn {",
 "\t}",
 "\t},",
 "\tmounted () {},",
 "\tmethods: {}",
 "}",
 "</script>",
 "<style scoped='scss' scoped>",
 "</style>"
 ],
 "description": "vue output to vue-template"
  }

At this point, have you discovered that vue template is a powerful tool for development? It works so well! ! ! ! !

This is the end of this article about the implementation of vscode custom vue template. For more relevant vscode custom vue template content, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to set vue template content in vscode
  • Implementation of Vue template in VsCode
  • VSCode writes vue project to generate .vue template with one click, and modifies the method of defining other templates
  • Detailed explanation of the process of quickly creating a Vue template using vscode
  • Configuration method of vscode vue file template
  • How to use .vue code template in vscode

<<:  Perfect solution to the problem that MySQL cannot connect to the database through localhost

>>:  When Nginx is turned on, the port is occupied and prompts: Address already in use

Recommend

React implements paging effect

This article shares the specific code for React t...

Not a Chinese specialty: Web development under cultural differences

Web design and development is hard work, so don&#...

Detailed explanation and examples of database account password encryption

Detailed explanation and examples of database acc...

Detailed Introduction to MySQL Innodb Index Mechanism

1. What is an index? An index is a data structure...

Use of Linux date command

1. Command Introduction The date command is used ...

Detailed tutorial on installing Docker on CentOS 8

1. Previous versions yum remove docker docker-cli...

3 ways to create JavaScript objects

Table of contents 1. Object literals 2. The new k...

How to hide a certain text in HTML?

Text hiding code, hide a certain text in HTML Copy...

Use of provide and inject in Vue3

1. Explanation of provide and inject Provide and ...

Introduction to Apache deployment of https in cryptography

Table of contents Purpose Experimental environmen...

Introduction to the use of this in HTML tags

For example: Copy code The code is as follows: <...

Detailed explanation of the middleman mode of Angular components

Table of contents 1. Middleman Model 2. Examples ...

Detailed example of using the distinct method in MySQL

A distinct Meaning: distinct is used to query the...

Example code for making the pre tag automatically wrap

The pre element defines preformatted text. Text en...