antvis/G6

[Bug]: getZoom is undefined #6589

rmd1710714107 posted onGitHub

Describe the bug / 问题描述

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

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 / 其他

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

posted by yvonneyx 5 months ago

Fund this Issue

$0.00
Funded

Pull requests