【发布时间】:2018-08-26 01:14:37
【问题描述】:
我和这个帖子有同样的问题 => Finding the correct import for a third party DefinitelyTyped module
我正在尝试将VanillaTilt 安装到我的 Angular (TS) 项目中。使用这个 index.d.ts... 我将 d.ts 保存在与 app.component.ts 相同的目录中,如下所示
import VanillaTilt from 'vanilla-tilt';
VanillaTilt.init(document.createElement('a'), { perspective: 1000 });
但我收到以下 ts 错误
ERROR in src/app/app.component.ts(3,8): error TS1192: Module '"vanilla-tilt"' has no default export.
我也尝试了d.ts 中的this version,但我不断收到Cannot read property 'init' of undefined
有人对如何在 agular5 中使用 VanillaTilt 有任何建议吗?
【问题讨论】:
标签: angular typescript definitelytyped