G6 icon indicating copy to clipboard operation
G6 copied to clipboard

Cannot read property 'attr' of null

Open bosscheng opened this issue 7 years ago • 3 comments

执行 graph.update() 方法的时候,报错

TypeError: Cannot read property 'attr' of null at Object.update (g6.js?07cd:1) at Object.update (g6.js?07cd:1) at e.updateShape (g6.js?07cd:1) at e.refresh (g6.js?07cd:1) at t.e.refreshItem (g6.js?07cd:1) at n.e.refreshItem (g6.js?07cd:1) at eval (g6.js?07cd:1) at Object.t.exports [as each] (g6.js?07cd:1) at t.e.updateItem (g6.js?07cd:1) at n.e.updateItem (g6.js?07cd:1)

bosscheng avatar Jun 11 '19 09:06 bosscheng

3.0.5-beta.6 版本。

bosscheng avatar Jun 12 '19 05:06 bosscheng

这种写法,压根解决不了问题。要么写个demo ,要么自己调试一下。

dxq613 avatar Jun 13 '19 10:06 dxq613

如果楼主是要更新节点的位置的话可以用 Item 的 updatePosition 方法,https://www.yuque.com/antv/g6/item#XoMRH,我也是在更新位置的时候用 graph.update() 报这个错,但是用 Item 的 updatePosition 方法就可以

jihaiying avatar Jan 03 '20 09:01 jihaiying