1.安装 vetur
2.在Setting.json中增加vetur设置:
"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
}
}