settings.json 中配置
vetur vue 文件 属性不换行
"vetur.format.defaultFormatter.html": "js-beautify-html", //prettier格式化代码
"vetur.format.defaultFormatterOptions": {
"prettier": {
"printWidth": 300,
"tabWidth": 2,
"singleQuote": true //用单引号
},
"js-beautify-html": {
"wrap_line_length": 300, //多少字符换行
"wrap_attributes": "aligned-multiple"
}
},
.prettierrc
{
"printWidth": 300,
"tabWidth": 2,
"singleQuote": true,
"htmlWhitespaceSensitivity": "ignore"
}