如图,没有配置前 如果代码过长,vetur会把尖括号整理到第二行换行,这样下来代码可读性特别差

修改一下vscode 的setting.json 来改善这个问题

"vetur.format.defaultFormatter.html": "js-beautify-html",
"vetur.format.defaultFormatter.js": "vscode-typ=script",
"vetur.format.defaultFormatterOptions": {
        "js-beautify-html": {
            "wrap_attributes": "auto"
        },
        "prettyhtml": {
            "printWidth": 100,
            "singleQuote": false,
            "wrapAttributes": false,
            "sortAttributes": false
        }
 },

结果如下:

 文章转载自:

https://www.jianshu.com/p/0000bb803b4bhttps://www.jianshu.com/p/0000bb803b4bhttps://www.jianshu.com/p/0000bb803b4b

Logo

前往低代码交流专区

更多推荐