需要安装 Vetur
{ "typescript.locale": "zh-CN", "vetur.format.options.tabSize": 4, "vetur.format.defaultFormatterOptions": { "js-beautify-html": { "wap_line_length": 5000, "end_with_newline": false, "tabWidth": 4, "printWidth": 200, "wrap_attributes": "auto", // - auto: 仅在超出行长度时才对属性进行换行。 // - force: 对除第一个属性外的其他每个属性进行换行。 // - force-aligned: 对除第一个属性外的其他每个属性进行换行,并保持对齐。 // - force-expand-multiline: 对每个属性进行换行。 // - aligned-multiple: 当超出折行长度时,将属性进行垂直对齐。 }, "prettyhtml": { "printWidth": 5000, "singleQuote": false, "wrapAttributes": false, "sortAttributes": false, "tabWidth": 4, }, }, "vetur.format.defaultFormatter.html": "js-beautify-html", "[javascript]": { "editor.defaultFormatter": "vscode.typescript-language-features", "editor.maxTokenizationLineLength": 10000000000, "editor.tabSize": 4, "editor.detectIndentation": false, }, "workbench.sideBar.location": "left", "git.confirmSync": false, // 头部注释 "fileheader.configObj": { "createHeader": true, }, "fileheader.customMade": { // 头部注释默认字段 "Author": "chengMingRui", "Date": "Do not edit", // 设置后默认设置文件生成时间 "LastEditTime": "Do not edit", // 设置后,保存文件更改默认更新最后编辑时间 "Description": "", "FilePath": "Do not edit", // 设置后,默认生成文件相对于项目的路径 }, "diffEditor.ignoreTrimWhitespace": true, "editor.codeActionsOnSave": { "source.fixAll": false }, "git.enableSmartCommit": true, "editor.wordWrap": "wordWrapColumn", "editor.tabSize": 4, "editor.wordWrapColumn": 500, "editor.detectIndentation": false, "editor.suggest.showIssues": false, "css.lint.important": "warning", // 避免使用 important 因为权重太高 "css.lint.ieHack": "ignore", "css.lint.compatibleVendorPrefixes": "warning", "[vue]": { "editor.defaultFormatter": "octref.vetur" },}