我如何在我的角4项目中实际使用gojs扩展?gojs已经添加到项目中,我在gojs节点模块中看到了扩展。
我的组件中有以下内容:
import * as go from 'gojs';
import TableLayout from '../../node_modules/gojs/extensionsTS/TableLayout';
ngOnInit() {
new TableLayout()
}但是我得到了以下构建错误:
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.发布于 2018-06-26 11:56:44
如果您正在使用npm
试着这样做:
npm install gojs -g --save
发布于 2019-06-07 10:00:08
试着使用
从‘gojs/ BalloonLink /balloonLink.js’导入{};
请注意,有/extensions和/extensionsTS路径。
编辑
此外,您还可以将gojs的node_modules复制并粘贴到本地文件夹中,然后作为组件导入。这对我有用。
https://stackoverflow.com/questions/49928523
复制相似问题