antvis / X6

🚀 JavaScript diagramming library that uses SVG and HTML for rendering.
https://x6.antv.antgroup.com
MIT License
5.7k stars 1.7k forks source link

原生node的linkhref无法动态修改 #4017

Open mingmingshiliyu opened 11 months ago

mingmingshiliyu commented 11 months ago

Describe the bug

image image

我对linkxhref进行修改后,node的数据已经修改了,但graph中却并没有产生变化.我直接在createNode的时候修改linkhref是有变化的,load到stencil之后copy就不行了

Your Example Website or App

none

Steps to Reproduce the Bug or Issue

把node放到stencil之后,然后取出到graph中后在进行修改.直接修改stencil里的是可以的

Expected behavior

图形变化

Screenshots or Videos

No response

Platform

Additional context

No response

mingmingshiliyu commented 11 months ago
var node = demoGraph.value.graph.getCellById(item.workflowNodeID);
          console.log("node节点:",node)
          console.log("图片:",node.attrs.img.xlinkHref)
          node.attrs.img.xlinkhref="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*SEISQ6My-HoAAAAAAAAAAAAAARQnAQ"
          node.attrs.img.xlinkHref="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*SEISQ6My-HoAAAAAAAAAAAAAARQnAQ"