VSCode开发Vue-代码格式化最完美设置Vue在VsCode上⾯的开发,代码格式话是个⽼⼤难问题了。
有很多⽂章介绍Prettier四个配置⽅法,以及如何启⽤。但是结果就是:⼀个⼀个配完,还是看着难受
中国一线城市现在尝试出⼀种最完美格式化⽅式,分享出来
1、安装Beautify插件
的和地的用法区别
2、修改设置:
两个地⽅
2.1 Editor: Word Wrap(控制折⾏的⽅式。):选择 bounded,可以根据窗⼝宽度⾃动调整换⾏
黄云山
2.2 Editor: Word Wrap Column((同时修改于: ) 为wordWrapColumn或bounded时,控制编辑器的折⾏列。)
这个是设置换⾏长度,根据⾃⼰显⽰器宽度设置
2、【重点】修改tting.json,漏了这⼀步就达不到效果了
{
"editor.tabSize": 2,
"vetur.format.defaultFormatter.html": "js-beautify-html", "vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
"wrap_attributes": "auto"
},
"prettyhtml": {
带走一盏渔火
"printWidth": 160,
"singleQuote": fal,
"wrapAttributes": fal,
长度公式"sortAttributes": fal
}
},
"arch.followSymlinks": fal,
"git.autorefresh": fal,
"firmDelete": fal,
"[html]": {
"editor.defaultFormatter": "HookyQR.beautify"
汉语言文学排名
},
"background.style": {
"content": "''",
"pointer-events": "none",
"position": "absolute",
在线课堂学习
"z-index": "99999",
"width": "50%",
"height": "100%",
"background-position": "50% 50%",
"background-repeat": "no-repeat",
穿越火线端游官网"opacity": 1
},
"ings.uWebExt": true,
"ings.donotShowInfoMsg": true,
"workbench.sideBar.location": "left",
"abled": fal,
"ings.fullReload": true,
"livereload.port": 5500,
"editor.largeFileOptimizations": fal,
"[javascript]": {
"editor.defaultFormatter": "HookyQR.beautify"
},
"files.autoSave": "afterDelay",
"editor.wordWrap": "bounded",
"editor.wordWrapColumn": 160,
"files.associations": {
},
}