和上一篇一样,安装了vetur插件,修改ta的配置文件
修改我框起来的地方
配置文件贴出来:
{
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
// "wrap_attributes": "force-expand-multiline"
"wrap_attributes": "auto"
},
"prettyhtml": {
// 单行超过100个长度的时候开始换行
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"wrapAttributes": true,
"sortAttributes": true,
},
"prettier": {
"semi": false,
"singleQuote": true
}
},
// 禁用vetur的JS格式化,交给eslint处理
"vetur.format.defaultFormatter.js": "none",
"vetur.format.defaultFormatter.html": "js-beautify-html"
}
亲测确实不换行了