When formatting a vue file in VSCode, single quotes change to double quotes, and a semicolon is automatically added.

First, you need to create a .prettierrc.json file in the root directory
Insert picture description here

Write in the file:

{
    
    
  "singleQuote": true,
  "semi": false
}

Insert picture description here

I tried to create this .prettierrc.json file in the root directory of the current project of Vue and found that it could not be created. Baidu can use the cmd command line to create it. I use the windows system (win10).

Specific steps:

Open the root directory of the current project of vue> enter cmd on the folder path and create with the command line> enter echo >.prettierrc.json> press Enter> the file ".prettierrc.json" is created in this folder
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_45811256/article/details/109248770