目录

标签: HTML

VSCode 编写vue文件将html标签格式化为一行

我的配置:

{
    "workbench.colorTheme": "One Dark Pro",
    "editor.tabSize": 2,
    "vetur.format.defaultFormatter.html": "js-beautify-html",
    "vetur.format.defaultFormatterOptions": {
        "js-beautify-html": {
            "wrap_attributes": "auto"
        },
        "prettyhtml": {
            "printWidth": 100,
            "singleQuote": false,
            "wrapAttributes": false,
            "sortAttributes": false
        }
    },
    "search.followSymlinks": false,
    "git.autorefresh": false,
    "explorer.confirmDelete": false,
    "[html]": {
        "editor.defaultFormatter": "HookyQR.beautify"
    },
    "workbench.sideBar.location": "left",
    "editor.largeFileOptimizations": false,
    "[javascript]": {
        "editor.defaultFormatter": "HookyQR.beautify"
    }
}

以上配置,你需要安装(我这里使用了一个VSCode的皮肤,可自行去掉):

  1. HookyQR.beautify
  2. One Dark Pro