Vue template configuration and webstorm code format specification settings

Vue template configuration and webstorm code format specification settings

1. Compiler code format specification settings

Usually when we write code, the code indentation is 4 spaces, but in the front end, according to global voting statistics, it is recommended to use 2 spaces for code indentation.

First, open the settings in webstorm . If you are using mac , use command + , shortcut to go to Editor-->Code Style-->HTML and change the values ​​of Tab size and Indent to 2. Similarly, change them to 2 in JavaScript .

2. Vue template configuration

When we use html to practice vue , if we don't want to create a vue instance object every time, we can configure a template in html and directly use the vue tag to introduce the code directly.

We open the settings in webstorm , go to Editor-->Live Templates , select vue , and click the +

Select Live Template , then write vue in Abbrevition and the template text content that needs to be configured in Template text .

Finally, on the current page, where there is a !, click Define

Then check HTML and click ok to complete.

To achieve the final effect, we directly enter vue in HTML , and then press tab , and we will immediately see the template code we just configured.


This is the end of this article about vue template configuration and webstorm code format specification settings. For more related vue webstorm content, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to use Webstorm and Chrome to debug Vue projects
  • WebStorm cannot correctly identify the solution of Vue3 combined API
  • How to run a Vue project with Idea or webstorm (detailed steps)
  • Set resolves.alias: ''@'' path based on vue project and adapt to webstorm
  • A fool-proof tutorial on how to build a vue-cli scaffold in webstorm
  • Solve the problem that the Webpack alias cannot be used in Vue cli scaffolding projects under Idea and WebStorm
  • How to initialize the project with webstorm+vue
  • vue: How to set up fast compilation and running in WebStorm
  • Detailed explanation of Vue syntax support in WebStorm
  • Solution to es6 syntax errors in webstorm and .vue

<<:  What are Web Slices?

>>:  CSS to achieve horizontal lines on both sides of the middle text

Recommend

Login interface implemented by html+css3

Achieve results First use HTML to build a basic f...

Comparative Analysis of MySQL Binlog Log Processing Tools

Table of contents Canal Maxwell Databus Alibaba C...

Use of Linux tr command

1. Introduction tr is used to convert or delete a...

A brief discussion on JavaScript shallow copy and deep copy

Table of contents 1. Direct assignment 2. Shallow...

How to use CSS media query aspect-ratio less

CSS media query has a very convenient aspect rati...

Solution to Tomcat server failing to open tomcat7w.exe

I encountered a little problem when configuring t...

Linux Autofs automatic mount service installation and deployment tutorial

Table of contents 1. Introduction to autofs servi...

How to implement nginx smooth restart

1. Background During the server development proce...

Docker container data volume named mount and anonymous mount issues

Table of contents What is a container data volume...

mysql5.7.17 installation and configuration example on win2008R2 64-bit system

123WORDPRESS.COM has explained to you the install...

jQuery implements a simple comment area

This article shares the specific code of jQuery t...

Complete steps to quickly build a vue3.0 project

Table of contents 1. We must ensure that the vue/...

Detailed explanation of CSS3 Flex elastic layout example code

1. Basic Concepts //Any container can be specifie...