antvis / G6

♾ A Graph Visualization Framework in JavaScript.

Home Page:https://g6.antv.antgroup.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

请问继承现有图形,自定义节点后,点击节点时,如何获取数据的id?

Aolef opened this issue · comments

commented

Describe the bug / 问题描述

扩展现有图形,自定义节点后,点击节点时,获取不到数据的id

Reproduction link / 重现链接

No response

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

建图
自定义节点

G6 Version / G6 版本

🆕 5.x

Operating System / 操作系统

Windows

Browser / 浏览器

Chrome

Additional context / 补充说明

No response

commented

事件对象: event.target.id
元素中:this.id

commented

第一张图里, event.target.id拿到的是空字符串,但是应该是有值的,是需要继承的时候做什么操作吗