试了很多方法都不行,以下方法可以解决:
把底下这段代码粘贴到 vscode的 setting.json 文件的后面中
"files.associations":{
"*.vue": "html"
}
粘贴之后:
{
"cSpell.customDictionaries": {
"custom-dictionary-user": {
"name": "custom-dictionary-user",
"path": "~/.cspell/custom-dictionary-user.txt",
"addWords": true,
"scope": "user"
}
},
"editor.formatOnSave": true,
"liveServer.settings.donotVerifyTags": true,
"liveServer.settings.donotShowInfoMsg": true,
"files.autoSave": "afterDelay",
"editor.mouseWheelZoom": true,
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.formatOnPaste": true,
"editor.formatOnType": true,
"cssrem.rootFontSize": 75,
"vetur.ignoreProjectWarning": true,
"editor.codeActionsOnSave": {
},
"files.associations":{
"*.vue": "html"
}
}
之后重新打开就可以了
版权声明:本文为m0_57809042原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。