当前位置: 首页 > 工具软件 > js-beautify > 使用案例 >

Vetur 格式化 js-beautify setting 换行配置

钱修雅
2023-12-01
默认格式化添加分号

编辑 setting -> users -> settings.json

//去掉JavaScript 自动添加分号
"vetur.format.defaultFormatter.js": "vscode-typescript",
.vue 文件组件自动换行
 "vetur.format.defaultFormatterOptions": {
        "js-beautify-html": {
            "wrap_line_length": 250, //换行长度
            "wrap_attributes": "auto", //属性换行
            "end_with_newline": false
        }
},
附上 js-beautify 部分配置文档
{
    "indent_size": 4,
    "indent_char": " ",
    "indent_with_tabs": false,
    "editorconfig": false,
    "eol": "\n",
    "end_with_newline": false,
    "indent_level": 0,
    "preserve_newlines": true,
    "max_preserve_newlines": 10,
    "space_in_paren": false,
    "space_in_empty_paren": false,
    "jslint_happy": false,
    "space_after_anon_function": false,
    "space_after_named_function": false,
    "brace_style": "collapse",
    "unindent_chained_methods": false,
    "break_chained_methods": false,
    "keep_array_indentation": false,
    "unescape_strings": false,
    "wrap_line_length": 0,
    "e4x": false,
    "comma_first": false,
    "operator_position": "before-newline",
    "indent_empty_lines": false,
    "templating": ["auto"]
}

Vetur Document 部分格式化规则的文档

 类似资料: