VScode格式化vue文件--避免html属性换行

前后对比

一、插件

安装Beautify和Vetur插件

二、编辑Beautify配置文件

 html里边增"vue"

"beautify.language": {       

        "js": {
            "type": [
                "javascript",
                "json"
            ],
            "filename": [
                ".jshintrc",
                ".jsbeautify"
            ]
        },
        "css": [
            "css",
            "scss"
        ],
        "html": [
            "htm",
            "html",
            "vue" //在这里加上vue
        ]
    }

 三、将Beautify插件设置为默认格式化代码插件

Shift+Alt+F愉快地格式化编码吧

猜你喜欢

转载自blog.csdn.net/qq_29752857/article/details/112846009
今日推荐