Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node setData后触发了node:change:data 事件,但是node:dbclick中没有拿到最新值 #4367

Closed
lunar9621 opened this issue Jul 24, 2024 · 1 comment

Comments

@lunar9621
Copy link

Describe the bug

有个需求 在node setData设置业务数据后,在双击该节点拿到最新数据进行后续交互:

但发现 在node:change:data事件的回调中 node的store已拿到了最新值且画布已重新渲染为最新值,但在node:dblclick回调中拿到的还是旧值

Your Example Website or App

none

Steps to Reproduce the Bug or Issue

  1. node.setData(
    {
    data:{ time: new Date().getTime() },
    },
    {
    deep: false,
    },
    )
  2. graph.on('node:dblclick', ({ node }) => {
    console.log('dblclickdata', node.getData());
    });

Expected behavior

graph.on('node:dblclick', ({ node }) => {
//拿到最新业务数据
});

Screenshots or Videos

No response

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 2.11.1]

Additional context

No response

@linqiqi077
Copy link

请问这个解决了吗?有解决方案吗?@lunar9621

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants