Emmet在模板中使用Vue.js在VSCode中使用'wrap with abbreviation‘命令的行为对我来说是错误的。
将代码块包装在任何元素(本例中为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": {
}
}发布于 2020-04-26 23:46:09
问题解决了。
原来我给我使用的快捷键分配了错误的emmet操作,我分配的是wrap individual lines with abbreviation而不是wrap with abbreviation
https://stackoverflow.com/questions/61443107
复制相似问题