antvis/G6











The issue has been closed
为什么使用自定义节点创建dom一直报错呢 #5330
Fz1120 posted onGitHub
G6 版本
4.x
问题描述
为什么使用
G6.registerNode('dom-node', {
draw(cfg, group) {
console.log(cfg);
const shape = group.addShape('dom', {
attrs: {
width: 200,
height: 100,
html: <div style="border:1px solid red;"></div>
}
})
return shape
}
})
自定义节点会报Uncaught TypeError: ShapeBase3[shapeType] is not a constructor
重现链接
0
重现步骤
0
预期行为
想通过自定义dom节点更好的去决定样式,但是一直报错
平台
- 操作系统: [macOS, Windows, Linux, React Native ...]
- 网页浏览器: [Google Chrome, Safari, Firefox]
- G6 版本: [4.5.1 ... ]
屏幕截图或视频(可选)
补充说明(可选)
No response