Advertisement

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)

还没有任何评论哟~