antvis/G6

Do you want to work on this issue?

You can request for a bounty in order to promote it!

Each re-render of the contextmenu increments the number of onclick triggers by one #6088

STofone posted onGitHub

Describe the bug / 问题描述

contextmenu每次重新渲染都会使onclick触发次数加一

https://g6.antv.antgroup.com/zh/examples/plugin/contextMenu#basic

Steps to Reproduce the Bug or Issue / 重现步骤

修改任意代码触发重新渲染

G6 Version / G6 版本

🆕 5.x

Operating System / 操作系统

Windows

Browser / 浏览器

Chrome

Additional context / 补充说明

No response


官网例子修改一下,重新渲染前需要调用destroy

posted by STofone 9 months ago

请教一下,Contextmenu.destroy() 怎么使用。

posted by away0722 9 months ago

请教一下,Contextmenu.destroy() 怎么使用。

graph.destroy()的时候会调用 getPluginInstance后调用也可以

posted by STofone 9 months ago

官网例子修改一下,重新渲染前需要调用destroy

具体描述下如何修改呢

posted by Aarebecca 9 months ago

官网例子修改一下,重新渲染前需要调用destroy

具体描述下如何修改呢

我本地是vue

onUnmounted(() => {
  graph.destroy();
});

能解决,看官网示例是怎么实现的了

posted by STofone 9 months ago

官网例子修改一下,重新渲染前需要调用destroy

具体描述下如何修改呢

我本地是vue

onUnmounted(() => {
  graph.destroy();
});

能解决,看官网示例是怎么实现的了

我本地getItems方法能执行,但是onclick却没有执行, graph.destroy也没用

posted by lhuazai 8 months ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests