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

[Bug]: getZoom is undefined #6589

Open
2 of 10 tasks
rmd1710714107 opened this issue Dec 2, 2024 · 1 comment
Open
2 of 10 tasks

[Bug]: getZoom is undefined #6589

rmd1710714107 opened this issue Dec 2, 2024 · 1 comment

Comments

@rmd1710714107
Copy link

Describe the bug / 问题描述

初始化图实例后立即调用getZoom函数报错:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'getZoom')

Reproduction link / 复现链接

No response

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

let graph = new Graph({       
     ...
});
console.log(graph.getZoom());

G6 Version / G6 版本

🆕 5.x

OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

Browser / 浏览器

  • Chrome
  • Edge
  • Firefox
  • Safari (Limited support / 有限支持)
  • IE (Nonsupport / 不支持)
  • Others / 其他
@yvonneyx
Copy link
Contributor

yvonneyx commented Dec 2, 2024

render 为异步操作,先 await 再调用 getZoom()

@yvonneyx yvonneyx removed the bug label Dec 2, 2024
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