vsCode generates vue templates with one click

vsCode generates vue templates with one click

1. Use the shortcut Ctrl + Shift + P to call out the console

2, then enter "snippets" and select

2. Then enter vue,

vs code automatically generates the vue.json file.

3. Change the vue.json file to the following template (you can modify the template content according to your personal needs)

{
      
        "Print to console": {
            "prefix": "vue",
            "body": [
                "<template>",
                " <div">$0</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"
        }
    }

Then create a new vue file, enter "vue", press the Enter key or Tab key, and the template will be automatically generated:

This is the end of this article about vsCode generating vue templates with one click. For more relevant vsCode generating vue templates, 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:
  • VSCode writes vue project to generate .vue template with one click, and modifies the method of defining other templates

<<:  Install Linux rhel7.3 operating system on virtual machine (specific steps)

>>:  getdata table table data join mysql method

Recommend

Detailed explanation of MySQL 8.0 atomic DDL syntax

Table of contents 01 Introduction to Atomic DDL 0...

An example of how Vue implements four-level navigation and verification code

Effect: First create five vue interfaces 1.home.v...

Perfect solution for theme switching based on Css Variable (recommended)

When receiving this requirement, Baidu found many...

How to introduce scss into react project

First download the dependencies yarn add sass-loa...

MySQL database Load Data multiple uses

Table of contents Multiple uses of MySQL Load Dat...

Vue implements countdown between specified dates

This article example shares the specific code of ...

How to use Volume to transfer files between host and Docker container

I have previously written an article about file t...

VMware virtualization kvm installation and deployment tutorial summary

Virtualization 1. Environment Centos7.3 Disable s...

Tips for using DIV container fixed height in IE6 and IE7

There are many differences between IE6 and IE7 in ...

Pure JavaScript to implement the number guessing game

Develop a number guessing game that randomly sele...

How to use TypeScript in Vue

introduction In recent years, the call for TypeSc...

How to implement blank space in Taobao with CSS3

Make a blank space for Taobao: When you shrink th...

Introduction to query commands for MySQL stored procedures

As shown below: select name from mysql.proc where...