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

小地图会影响vue组件,导致vue组件会进两次mounted,性能上可能会有影响。 #3738

Closed
Huzi-y opened this issue Jul 6, 2023 · 7 comments

Comments

@Huzi-y
Copy link

Huzi-y commented Jul 6, 2023

Describe the bug

用vue绘制的节点,发现修改数据,监听node.on("change:data", ({ current }) => {console.log(current)})每次都会输出两个current,我在在mounted的时候去订阅的数据变更,我发现mounted进了两次,逐步排查之后,发现把小地图去掉就不会进两次mounted了。其他的节点暂时还不知道有没有影响,希望排查下。

Your Example Website or App

https://codesandbox.io/p/sandbox/quirky-forest-7j89x6?file=%2Fsrc%2Fcomponents%2FHelloWorld.vue%3A23%2C3-23%2C78

Steps to Reproduce the Bug or Issue

graph.use(new MiniMap({ container: document.getElementById("minimap")! })); vue节点会进入两次mounted。

Expected behavior

加小地图应该不影响节点绘制

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

@Huzi-y
Copy link
Author

Huzi-y commented Jul 6, 2023

image

@lloydzhou
Copy link
Contributor

这里。小地图也是一样的组件。进行两次mount是正常的。

你这里的需求,可以参考https://x6.antv.antgroup.com/tutorial/plugins/minimap 文档中针对小地图生成简单的view,这样小地图中的view可以更简单。不用走复杂的逻辑。

@Huzi-y
Copy link
Author

Huzi-y commented Jul 6, 2023

这里。小地图也是一样的组件。进行两次mount是正常的。

你这里的需求,可以参考 https://x6.antv.antgroup.com/tutorial/plugins/minimap 文档中针对小地图生成简单的view,这样小地图中的view可以更简单。不用走复杂的逻辑。

我这个是小地图一开始应该就创建好了,后面创建的vue节点每次都会进两次mounted,是自定义vue节点的mounted。

@Huzi-y
Copy link
Author

Huzi-y commented Jul 6, 2023

这里。小地图也是一样的组件。进行两次mount是正常的。

你这里的需求,可以参考 https://x6.antv.antgroup.com/tutorial/plugins/minimap 文档中针对小地图生成简单的view,这样小地图中的view可以更简单。不用走复杂的逻辑。

image

@lloydzhou
Copy link
Contributor

小地图,也是一个画布。
节点需要在主画布展示,同时也需要在小地图展示。
所以,这个节点需要挂载两次,这是正常流程。

@Huzi-y
Copy link
Author

Huzi-y commented Jul 6, 2023

小地图,也是一个画布。 节点需要在主画布展示,同时也需要在小地图展示。 所以,这个节点需要挂载两次,这是正常流程。
明白了,谢谢。那我用那个简单视图展示,用这个绘的节点多了明显的有感觉变慢了。

@Huzi-y Huzi-y closed this as completed Jul 6, 2023
@x6-bot
Copy link
Contributor

x6-bot bot commented Jul 6, 2024

This thread has been automatically locked because it has not had recent activity.

Please open a new issue for related bugs and link to relevant comments in this thread.

@x6-bot x6-bot bot locked as resolved and limited conversation to collaborators Jul 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants