Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

无法找到模块“vue-infinite-scroll”的声明文件。“C:/Users/万子聪/Desktop/web/template/node_modules/[email protected]@vue-infinite-scroll/vue-infinite-scroll.js”隐式拥有 "any" 类型。
Try `npm install @types/vue-infinite-scroll` if it exists or add a new declaration (.d.ts) file containing `declare module


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
459 views
Welcome To Ask or Share your Answers For Others

1 Answer

在项目根目录下新建一个declaration.d.ts文件,内容如下:

declare module 'vue-infinite-scroll' {
    const vis: any;
    export default vis;
}

这样再引用就不会报错了


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...