vue3 + ts 的一个错误?-灵析社区

ApplePro

![image.png](https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20241116/7f2f8d8d2153c1bab9d19be60d299296.png) ![image.png](https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20241116/bf8c76728972c64f5d0c4034dbb65e40.png) 这不是都找到类型了吗?这个报错是什么意思?如何解决呢? //1.d.ts type nh = import('ant-design-vue/es/message').MessageApi; interface nhanh { nh: nh } // **.vue const { } = defineProps(); //vite.config.ts *** export default defineConfig({ *** plugins: [ vue({ script: { globalTypeFiles: [ "src/views/1.d.ts" ] } }), ], }) // 版本 *** "dependencies": { *** "@types/three": "^0.154.0", "pinia": "^2.1.7", "vue": "^3.3.4", }, "devDependencies": { "@rushstack/eslint-patch": "^1.3.3", "@tsconfig/node18": "^18.2.2", "@types/jsdom": "^21.1.3", "@types/node": "^18.18.5", "@vitejs/plugin-vue": "^4.4.0", "@vitejs/plugin-vue-jsx": "^3.0.2", "@vue/eslint-config-prettier": "^8.0.0", "@vue/eslint-config-typescript": "^12.0.0", "@vue/test-utils": "^2.4.1", "@vue/tsconfig": "^0.4.0", "eslint": "^8.49.0", "eslint-plugin-vue": "^9.17.0", "jsdom": "^22.1.0", "less": "^4.2.0", "npm-run-all2": "^6.1.1", "prettier": "^3.0.3", "tsconfig-paths": "^4.2.0", "typescript": "~5.2.0", "unplugin-vue-components": "^0.25.2", "vite": "^4.4.11", "vitest": "^0.34.6", "vue-tsc": "^1.8.19" } 消除错误

阅读量:21

点赞量:0

问AI
"vue 3.3+" 才支持引用外部的type "https://blog.vuejs.org/posts/vue-3-3#imported-and-complex-typ..." (https://link.segmentfault.com/?enc=gwOEfo523dPYcsJ82VOClQ%3D%3D.8P%2FmOTmVHOExjIL%2B2Cgnfq7%2FHA4Q3IugtCHHCArCan%2BvRU0VVPJa0OeEnfIiVYnY2y6x9%2BO7KdmQ9jn6MD8ZjLV8HNhZiHfObmlxO3%2FoWAZ0DENk5V512TQQs5h6jO7L)