antvis/G6

V5 入门-快速上手-CDN方式引入,示例代码无法运行 #5069

jmcdjyu posted onGitHub

问题描述

V5 入门-快速上手-CDN方式实例代码无法运行,报错:Uncaught ReferenceError: G6 is not defined 文档中,完整代码中引用的G6库为: https://gw.alipayobjects.com/os/lib/antv/g6/5.0.0-beta.21/dist/g6.min.js

重现链接

不会用,没有

重现步骤

  1. 复制 https://g6-next.antv.antgroup.com/manual/getting-started#完整代码 这个URL中的代码
  2. 保存为本地index.html,去掉 /* 图的画布容器 / 和 / 引入 G6 */ 这两个注释
  3. 用chrome或edge浏览器打开index.html

预期行为

我期望看到图显示,但是看到了白屏页面,F12进入调试模式,发现报错。

平台

  • 操作系统: Windows 10
  • 网页浏览器: Google Chrome
  • G6 版本: 5.0-alpha

屏幕截图或视频(可选)

image image

补充说明(可选)

No response


hi @jmcdjyu, welcome!

posted by github-actions[bot] over 1 year ago

Hi @jmcdjyu, Please star this repo if you find it useful! Thanks :star:! 你好 @jmcdjyu。如果该仓库对你有用,可以 star 一下,感谢你的 :star:!

posted by github-actions[bot] over 1 year ago

@jmcdjyu 应该是需要把代码中的 G6 改成 G6V5,5.0 版本当前打包的 umd 挂在全局变量名为 G6V5。

posted by hustcc over 1 year ago

@jmcdjyu 应该是需要把代码中的 G6 改成 G6V5,5.0 版本当前打包的 umd 挂在全局变量名为 G6V5。

@hustcc 你好!修改后,还是报错 image

posted by slimming-fat over 1 year ago

Fund this Issue

$0.00
Funded

Pull requests