从npm包中导入带有typescript的dropzoneJs

时间:2019-06-30 14:42:50

标签: javascript typescript import dropzone.js

我已经使用npm安装了@types/dropzonedropzone,所以我安装了package.json

"@types/dropzone": "^5.0.6", 
"dropzone": "^5.5.1", 

然后我将其导入index.ts中:

import * as Dropzone from 'dropzone'; 

但是当我尝试如下使用它时:

new Dropzone("div#dropzone", { url: "/file/post" }) 

我收到此错误:

TypeError: Dropzone is not a constructor 

我什至找不到import ...甚至没有在其official npm page上导入该库的方法

有人有什么想法吗?

0 个答案:

没有答案