module.exports = { 预设:[“@vue/cli-plugin-babel/preset”], };</pre> <p>设置,json{ "editor.insertSpaces": false, "editor.minimap.enabled": false, "文件.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>
P粉1639513362023-08-26 10:54:42
我之前也遇到了同样的问题,用以下代码修复:
<script lang="ts"> ... </script>
如果对你有用,请告诉我。