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

A solution to the abnormal exit of Tomcat caused by semaphore

I'm playing with big data recently. A friend ...

5 super useful open source Docker tools highly recommended

Introduction The Docker community has created man...

JavaScript Basics Variables

Table of contents 1. Variable Overview 1.1 Storag...

A detailed introduction to the use of block comments in HTML

Common comments in HTML: <!--XXXXXXXX-->, wh...

Detailed code for implementing 3D tag cloud in Vue

Preview: Code: Page Sections: <template> &l...

Html comments Symbols for marking text comments in Html

HTML comments, we often need to make some HTML co...

MySQL 5.6 root password modification tutorial

1. After installing MySQL 5.6, it cannot be enabl...

Analysis of the principle and usage of MySQL continuous aggregation

This article uses examples to illustrate the prin...

Hidden overhead of Unix/Linux forks

Table of contents 1. The origin of fork 2. Early ...

Install nvidia graphics driver under Ubuntu (simple installation method)

Install the nvidia graphics card driver under Ubu...

JavaScript implements simple date effects

The specific code of JavaScript date effects is f...

How to elegantly implement the mobile login and registration module in vue3

Table of contents Preface Input box component lay...