1

Emmet 在 VSCode 中使用 Vue.js 在模板中的“用缩写包装”命令对我来说行为不端。

将代码块包装在任何元素内(div在此示例中)会导致删除该代码块内的所有缩进。

我已经尝试调整各种设置,但无法弄清楚是什么导致它像这样格式化!

前: 前:

后: 后:

我的 settings.json 文件如下所示:

{
    "editor.fontLigatures": true,
    "editor.tabSize": 2,
    "vetur.validation.template": false,
    "vetur.completion.useScaffoldSnippets": false,
    "emmet.syntaxProfiles": {
        "html": {
            "attr_quotes": "single",
            "indent": true,
            "tag_nl": true
        },
        "vue-html": "html",
        "vue": "html"
    },
    "window.zoomLevel": -1,
    "editor.fontSize": 14,
    "sync.gist": "bcd2ebd3919d3e74184418b308e3aa85",
    "javascript.updateImportsOnFileMove.enabled": "always",
    "javascript.preferences.quoteStyle": "single",
    "vetur.format.defaultFormatter.html": "none",
    "vetur.complete": true,
    "workbench.iconTheme": "chalice-icon-theme",
    "material-icon-theme.saturation": 0.5,
    "editor.fontFamily": "'Fira Code', 'Courier New', monospace",
    "workbench.colorCustomizations": {
        "titleBar.activeBackground": "#000",
        "tab.activeBorder": "#ffff73"
    },
    "editor.minimap.enabled": false,
    "explorer.openEditors.visible": 0,
    "editor.wrappingIndent": "indent",
    "editor.formatOnType": false,
    "editor.formatOnSave": false,
    "editor.formatOnPaste": false,
    "editor.detectIndentation": true,
    "emmet.excludeLanguages": [
        "markdown"
    ],
    "[vue]": {
        "editor.defaultFormatter": "octref.vetur"
    },
    "vetur.format.defaultFormatterOptions": {
    },
    "emmet.extensionsPath": "",
    "vetur.completion.scaffoldSnippetSources": {

    }
}
4

1 回答 1

1

问题解决了。

原来我有错误的 emmet 动作分配给我正在使用的键盘快捷键,我分配wrap individual lines with abbreviation而不是wrap with abbreviation

于 2020-04-26T15:46:09.170 回答