Detailed explanation of Vue save automatic formatting line break

Detailed explanation of Vue save automatic formatting line break

I searched for many ways to change it online but it didn't work. Later I saw it from a big guy and took it off. As for the font, I still use the original system font, which looks comfortable, so I added it myself. You can modify it yourself if you need to. In the upper right corner, go to File--Preferences--Settings--Search for setting---Edit in setting.json, comment out the others, and replace it with the following code block. The font size and line height can be modified by yourself

{
  //Set the text size "editor.fontSize": 18,
  //Set text line height "editor.lineHeight": 20,
  //Open line number prompt "editor.lineNumbers": "on",
  // Show a small panel with parameter documentation and type information on input.
  "editor.parameterHints.enabled": true,
  // Adjust the zoom level of the window "window.zoomLevel": 0,
  // File Directory // "workbench.iconTheme": "vscode-icons",
  // Set the font "editor.fontFamily": "'Consolas','Droid Sans Mono', 'Courier New', monospace, 'Droid Sans Fallback'",
  // Automatic line wrap "editor.wordWrap": "on",
  // Customize vscode panel color "workbench.colorCustomizations": {
    // "tab.activeBackground": "#253046", // Background color of the active tab// "activityBar.background": "#253046", // Background color of the activity bar// "sideBar.background": "#253046", // Background color of the sidebar// "activityBar.foreground": "#23f8c8", // Foreground color of the activity bar (e.g. for icons)
    "editor.background": "#292a2c" //Editor background color},
  // By default, vscode enables the option "editor.detectIndentation": false, which automatically sets the tabsize based on the file type.
  // Reset tabsize
  "editor.tabSize": 2,
  // #Automatically format each time you save "editor.formatOnSave": true,
  // #Add a space between the function (name) and the following parentheses "javascript.format.insertSpaceBeforeFunctionParenthesis": true,
  // #This is selected according to the user's own habits "vetur.format.defaultFormatter.html": "js-beautify-html",
  // #Let the js in vue be formatted according to the ts format that comes with the editor "vetur.format.defaultFormatter.js": "vscode-typescript",
  // Code ESLint action type to run on save.
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },
  // Add emmet support vue file "emmet.includeLanguages": {
    "wxml": "html",
    "vue": "html"
  },
  // Whether to wrap the two selectors "minapp-vscode.disableAutoConfig": true,
  //Quick preview (right side)
  "editor.minimap.enabled": true,
  // tab code completion "files.associations": {
    "*.wpy": "vue",
    "*.vue": "vue",
    "*.cjson": "jsonc",
    "*.wxss": "css",
    "*.wxs": "javascript"
  },
  // Used to configure how to start ESLint using the ESLint CLI engine API. Defaults to empty options "eslint.options": {
    "extensions": [
      ".js",
      ".vue"
    ]
  },
  // Execute linter in onSave or onType. The default is onType.
  "eslint.run": "onSave",
  // Enable ESLint as a formatter for validated files.
  "eslint.format.enable": true,
  // Array of language identifiers for which the ESLint extension should be activated and should try to validate files.
  "eslint.probe": [
    "javascript",
    "javascriptreact",
    "vue-html",
    "vue",
    "html"
  ],
  //Close the rg.exe process and use cnpm, which will cause rg.exe to occupy a lot of memory. "search.followSymlinks": false,
  // Set property partition for js-beautify-html "vetur.format.defaultFormatterOptions": {
    "js-beautify-html": {
      "wrap_attributes": "auto",
      "wrap_line_length": 200,
      "end_with_newline": false
    },
    "prettyhtml": {
      "printWidth": 200,
      "singleQuote": false,
      "wrapAttributes": false,
      "sortAttributes": false
    },
    "prettier": {
      "semi": false,
      "singleQuote": true
    }
  },
  // style defaults to an indent offset
  "vetur.format.styleInitialIndent": true,
  // Define the space after the function keyword of the anonymous function.
  "javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
  // Define how to handle spaces before function parameter brackets.
  "typescript.format.insertSpaceBeforeFunctionParenthesis": true,
  // New version message "vsicons.dontShowNewVersionMessage": true,
  // Controls whether Explorer confirms when deleting files to the Trash.
  "explorer.confirmDelete": true,
  // Use eslint-plugin-vue to verify vue-html in <template>
  "vetur.validation.template": false,
  // Specify the color theme to use in the workbench.
  // "workbench.colorTheme": "One Dark Pro"
}

Summarize

This article ends here. I hope it can be helpful to you. I also hope you can pay more attention to more content on 123WORDPRESS.COM!

You may also be interested in:
  • Vue solves the problem of line breaks in prompt information using $notify in element
  • Solve the pitfall of Vue curly bracket character wrapping
  • Solve the Vue string wrapping problem (absolutely useful)
  • Example code for Vue flex layout to achieve div equal division and automatic line wrapping
  • Example of using v-html to wrap text by semicolon in vue

<<:  How to implement mobile web page size adaptation

>>:  mysql subquery and join table details

Recommend

js Promise concurrent control method

Table of contents question background Idea & ...

CSS controls the spacing between words through the letter-spacing property

letter-spacing property : Increase or decrease th...

CSS animation combined with SVG to create energy flow effect

The final effect is as follows: The animation is ...

Solution to EF (Entity Framework) inserting or updating data errors

Error message: Store update, insert, or delete st...

Upgrade Docker version of MySQL 5.7 to MySQL 8.0.13, data migration

Table of contents 1. Back up the old MySQL5.7 dat...

Example code for implementing hollowing effect with CSS

Effect principle Mainly use CSS gradient to achie...

JavaScript to achieve calendar effect

This article shares the specific code for JavaScr...

Three ways to configure JNDI data source in Tomcat

In my past work, the development server was gener...

Completely delete MySQL steps

Table of contents 1. Stop MySQL Server first 2. U...

js to implement add and delete table operations

This article example shares the specific code of ...

How to deploy kafka in docker

Table of contents 1. Build Docker 2. Enter the co...

IE8 compatibility notes I encountered

1. IE8's getElementById only supports id, not ...