|
|
善良的回锅肉 · ckeditor ...· 1 年前 · |
|
|
八块腹肌的春卷 · 用TypeScript开发Vue——如何通过 ...· 2 年前 · |
|
|
朝气蓬勃的饭盒 · 彻底解决让用户清一下浏览器缓存 - 掘金· 2 年前 · |
|
|
鬼畜的枕头 · ComboBox.SelectedText ...· 2 年前 · |
|
|
私奔的火车 · pyspark - ...· 2 年前 · |
我有一个示例typscript项目,它是我从github克隆的,并随npm install一起安装。
在index.ts中,我正在尝试导入第三方模块(
https://github.com/ScatterCo/Depthkit.js
)。此模块已使用
npm install depthkit
下载到node_modules文件夹中
为了导入模块,我尝试了
import {DepthKit} from 'depthkit/build/depthkit';
或
import * as DK from 'depthkit/build/depthkit';
但是当我运行
var depthkit = new DepthKit();
或
var depthkit = new DK.DepthKit();
时,我得到了一个错误的
Uncaught TypeError: depthkit_1.DepthKit is not a constructor
我该怎么解决这个问题?
根据我读到的代码,正确的导入应该是
import DepthKit from "depthkit"
,因为DepthKit类是索引默认导出
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2023 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号: 粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
扫码关注腾讯云开发者
领取腾讯云代金券
|
|
朝气蓬勃的饭盒 · 彻底解决让用户清一下浏览器缓存 - 掘金 2 年前 |