Integrating JSPlumb in Vue results in a `Cannot read property 'parentNode' of null` error and prevents connection rendering.
发布时间
阅读量:
阅读量
简介
在该项目开发过程中,我采用了typescript、vue以及jsplumb作为构建流程图功能的核心技术框架。
问题
在容器内部,我采用v-for指令完成界面渲染工作。
- 首先从配置文件中提取流程图对应的json数据,并将其存储至
this.items变量中 - 接着利用v-for指令,通过调用
this.item的方式,生成多个组件实例以构成流程图的各个节点 - 最后在
this.paintFlowchart方法内部,执行对端口Endpoint以及连线Connector的创建操作
代码:
mounted(){
this.items = JSON.parse(JSON.stringify(demoGraph));
this.paintFlowchart();
}
在执行编译与运行操作后,控制台提示出现TypeError: Cannot read properties of null (reading 'parentNode')的错误信息。与此同时,在前端页面中仅能观察到节点元素,而连接线(Connector)与端点(Endpoint)却未能正常显示。经过长时间的思考与反复尝试,
全部评论 (0)
还没有任何评论哟~
