module.exports = { 預設:[“@vue/cli-plugin-babel/preset”], };</pre>設置,json
{ "editor.insertSpaces": false, "editor.minimap.enabled": false, "files.eol": "n", "workbench.sideBar.location": "右", "php-cs-fixer.executablePath": "${extensionPath}\php-cs-fixer.phar", 「發射」: { “配置”:[], “化合物”:[] }, "debug.javascript.usePreview": false, 「窗口.zoomLevel」:3, “eslint.format.enable”:true }</pre> <p>package.json</p>{ 「依賴項」:{ "core-js": "^3.6.5", "vue": "^3.0.0", “vue-class-component”:“^8.0.0-0” }, 「開發相依性」:{ "@typescript-eslint/eslint-plugin": "^4.18.0", "@typescript-eslint/parser": "^4.18.0", "@vue/cli-plugin-babel": "~4.5.0", "@vue/cli-plugin-eslint": "~4.5.0", "@vue/cli-plugin-typescript": "~4.5.0", "@vue/cli-service": "~4.5.0", "@vue/compiler-sfc": "^3.0.0", "@vue/eslint-config-prettier": "^6.0.0", "@vue/eslint-config-typescript": "^7.0.0", "eslint": "^6.7.2", "eslint-plugin-prettier": "^3.3.1", "eslint-plugin-vue": "^7.0.0", "更漂亮": "^2.2.1", “打字稿”:“~4.1.5” }, “eslint配置”:{ 「根」:正確, 「環境」:{ “節點”:真 }, 「延伸」:[ “插件:vue/vue3-essential”, “eslint:推薦”, “@vue/typescript/推薦”, “@vue/更漂亮”, “@vue/prettier/@typescript-eslint” ], “解析器選項”:{ “ecma版本”:2020 }, 「規則」:{} }, “瀏覽器列表”:[ “>1%”, “最後兩個版本”, “沒死” ] }</pre> <p><br />></p>
我之前也遇到了同樣的問題,用以下程式碼修復:
如果對你有用,請告訴我。