vs code 自动格式化不换行

vs code 安装 vetur 插件,在 vscode 的配置文件 settings.js 中添加配置

"vetur.format.options.tabSize": 4,  //缩进设置
    "vetur.format.defaultFormatter.html": "js-beautify-html", // html 不换行
    "vetur.format.defaultFormatter.js": "vscode-typescript", // js 不换行
    "vetur.format.defaultFormatterOptions": {
        "js-beautify-html": {
            "wrap_line_length": 0, // 设置多个字符后换行 0 表示忽略
            "wrap_attributes": "auto", // html 标签属性 换行设置[auto|force|force-aligned|force-expand-multiline] ["auto"]
            "end_with_newline": false // 在文件结尾添加新行
        },
        "prettier": {
            "semi": true, //要不要分号
            "singleQuote": true //单引号
        }
    }

你可能感兴趣的:(vs code 自动格式化不换行)