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

Analysis and practice of React server-side rendering principle

Most people have heard of the concept of server-s...

HTML optimization speeds up web pages

Obvious HTML, hidden "public script" Th...

CentOS system rpm installation and configuration of Nginx

Table of contents CentOS rpm installation and con...

Batch replace part of the data of a field in Mysql (recommended)

Batch replace part of the data of a field in MYSQ...

Implementation code of front-end HTML skin changing function

50 lines of code to change 5 skin colors, includi...

Docker /var/lib/docker/aufs/mnt directory cleaning method

The company's service uses docker, and the di...

CSS Standard: vertical-align property

<br />Original text: http://www.mikkolee.com...

Docker win ping fails container avoidance guide

Using win docker-desktop, I want to connect to co...

wget downloads the entire website (whole subdirectory) or a specific directory

Use wget command to download the entire subdirect...

5 Tips for Protecting Your MySQL Data Warehouse

Aggregating data from various sources allows the ...

CSS method of controlling element height from bottom to top and from top to bottom

Let’s start the discussion from a common question...

React mouse multi-selection function configuration method

Generally, lists have selection functions, and si...