首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在角度工程中使用gojs扩展

如何在角度工程中使用gojs扩展
EN

Stack Overflow用户
提问于 2018-04-19 19:10:08
回答 2查看 930关注 0票数 1

我如何在我的角4项目中实际使用gojs扩展?gojs已经添加到项目中,我在gojs节点模块中看到了扩展。

我的组件中有以下内容:

代码语言:javascript
复制
import * as go from 'gojs';
import TableLayout from '../../node_modules/gojs/extensionsTS/TableLayout'; 

ngOnInit() {
    new TableLayout()
}

但是我得到了以下构建错误:

代码语言:javascript
复制
ERROR in node_modules/gojs/extensionsTS/TableLayout.ts(414,8):
        error TS2403: Subsequent variable declarations must have the same type. Variable 'child' must be of type 'Part', but here has type 'any'.
    node_modules/gojs/extensionsTS/TableLayout.ts(445,8):
        error TS2403: Subsequent variable declarations must have the same type. Variable 'child' must be of type 'Part', but here has type 'any'.
    node_modules/gojs/extensionsTS/TableLayout.ts(542,9):
        error TS2403: Subsequent variable declarations must have the same type. Variable 'child' must be of type 'Part', but here has type 'any'.
    src/app/app.component.ts(3,8):
        error TS1192: Module '"D:/projects/gojs-app1/node_modules/gojs/extensionsTS/TableLayout"' has no default export.
EN

回答 2

Stack Overflow用户

发布于 2018-06-26 11:56:44

如果您正在使用npm

试着这样做:

npm install gojs -g --save

票数 0
EN

Stack Overflow用户

发布于 2019-06-07 10:00:08

试着使用

从‘gojs/ BalloonLink /balloonLink.js’导入{};

请注意,有/extensions/extensionsTS路径。

编辑

此外,您还可以将gojs的node_modules复制并粘贴到本地文件夹中,然后作为组件导入。这对我有用。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49928523

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档