我正在开发一个使用 typescript 的项目(使用 vue cli 3.0 生成)。
当我导入第三方模块时,出现如下错误:
Could not find a declaration file for module 'vue-slider-component'.
'/home/wahid/Development/tealvalley-app/node_modules/vue-slider-
component/dist/index.js' implicitly has an 'any' type.
解决此类问题的正确方法是什么?这些类型没有在 @types 包中定义,所以如果我自己定义它们,我应该把它保存在哪里?
最佳答案
What is the correct way to resolve these kind of issues?
创建文件vendor.d.ts
有:
declare module 'vue-slider-component';
关于typescript - 找不到第三方模块的声明文件 - 如何声明和解决这些错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50360164/