Vscode 格式化vue Template代码段

1.安装 vetur

2.在User Setting中增加设置:

"vetur.format.options.useTabs": true,
    "vetur.format.defaultFormatter.html": "js-beautify-html",
    "vetur.format.defaultFormatterOptions": {
        "js-beautify-html": {
            "wrap_attributes": "auto"
        },
        "prettier": {
            "singleQuote": true,
            "semi": true,
            "tabWidth": 4
        },
        "prettyhtml": {
            "singleQuote": false,
            "wrapAttributes": false,
            "sortAttributes": false
        }
    }

3.搞定

格式化快捷键:Alt+Shift+F