angular - jsPlumb 函数失败:TypeError:无法读取未定义的属性(正在读取“resetBounds”)
问题描述
当我添加类型为“Bezier”的连接器属性时,添加连接时会抛出
jsPlumb function failed : TypeError: Cannot read properties of undefined (reading 'resetBounds')
ERROR TypeError: Cannot read properties of undefined (reading 'canvas')
at BrowserJsPlumbInstance.setConnectorHover (jsplumb.browser-ui.es.js:4774)
我将以下属性添加到 addEndPoint
import {BezierConnector} from '@jsplumb/connector-bezier'
{
endpoint: {
type: DotEndpoint.type,
options:{
radius: 7
}
},
paintStyle: { fill: '#99cb3a' },
source: true,
connector:{
type:BezierConnector.type,
options:{
curviness:50
}
},
}
解决方案
为了将来遇到此问题的人们的利益,该问题已在 Github 上进行了讨论,原因似乎是 jsPlumb 包的混合版本。
您必须使用相同版本的@jsplumb/connector-flowchart
as@jsplumb/browser-ui
等。理论上这是由包本身强制执行的;在这种情况下,不匹配是如何产生的还不清楚。
推荐阅读
- json - 无法让 ESP8266 从互联网上获取 JSON
- ansible - ansible正则表达式抓取目标机器IP地址
- javascript - 将数据从 PHP 发送到 Javascript 到 PHP
- wordpress - 使用 http 和 https 访问 wordpress
- javascript - 无法从 MongoDB 获取数据
- grails - 你能告诉我如何保存我的域类吗
- c# - msbuild Directory.Build.props 即使在非常基本的示例中也不起作用
- c++ - 对使用 Glib 事件循环的程序使用 Google 测试
- quarkus - 无法使用 GraalVM 生成本机图像
- javascript - 如何在 jquery Laravel 中使用翻译