[英]How can I import RealtimeDragSelectingTool in go.js?
I use go.js as npm module, via Webpack. 我通过Webpack将go.js用作npm模块。 I would like to try RealtimeDragSelectingTool ( https://github.com/NorthwoodsSoftware/GoJS/blob/master/extensions/RealtimeDragSelectingTool.js ) but the way of use in the provided documentation doesn't work. 我想尝试RealtimeDragSelectingTool( https://github.com/NorthwoodsSoftware/GoJS/blob/master/extensions/RealtimeDragSelectingTool.js ),但是提供的文档中的使用方式无效。 I import it like this: 我这样导入:
import RealtimeDragSelectingTool from 'gojs/extensions/RealtimeDragSelectingTool'
If I use go.GraphObject.make(RealtimeDragSelectingTool)
, it raises the following error: 如果我使用go.GraphObject.make(RealtimeDragSelectingTool)
,则会引发以下错误:
GraphObject.make requires a class function or GoJS class name or name of an object builder, not: [object Object]" GraphObject.make需要类函数或GoJS类名称或对象生成器的名称,而不是:[object Object]“
What am I doing wrong? 我究竟做错了什么?
import { RealtimeDragSelectingTool } from './gojs/extensionsTS/RealtimeDragSelectingTool';
extensionsTS
目录中的现有JS文件采用UMD模块格式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.