前言
vue文件格式化 需要安裝插件 Vetur 可自行百度
默認(rèn)格式化的
屬性自動換行尸闸,導(dǎo)致一個(gè)文件千百行 画舌,看著不舒服奠货,最關(guān)鍵的是標(biāo)簽無法折疊了介褥,這是最不能忍的
打開設(shè)置
搜索vetur.format
編輯 setting.json文件
{
"window.zoomLevel": 1,
"files.associations": {
"*.wpy": "vue",
"*.cjson": "jsonc",
"*.wxss": "css",
"*.wxs": "javascript"
},
"vetur.format.defaultFormatter.html": "js-beautify-html",
"emmet.includeLanguages": {
"wxml": "html"
},
"minapp-vscode.disableAutoConfig": true,
"explorer.confirmDelete": false,
"vetur.format.options.tabSize": 4,
"vetur.format.defaultFormatterOptions":{
"js-beautify-html":{
"wrap_attributes":"auto"
}
}
}
效果展示
清爽多了