VScode format vue file-avoid HTML attribute wrapping

Before and after comparison

One, plug-in

Install Beautify and Vetur plugins

Two, edit the Beautify configuration file

 Add "vue" in html

"beautify.language": {       

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

 3. Set the Beautify plug-in as the default formatting code plug-in

Shift+Alt+F format the code happily

Guess you like

Origin blog.csdn.net/qq_29752857/article/details/112846009