X6
X6 copied to clipboard
addChild 子节点不显示
Describe the bug
遇到两个问题: 父节点需要先添加到画布上,子节点才会显示 https://codesandbox.io/s/affectionate-leftpad-vv1tnl?file=/src/app.tsx
如果先把子节点添加到画布上,然后再把父节点添加到画布上,则只有一个子节点会有父子关系 https://codesandbox.io/s/elated-faraday-58dv57?file=/src/app.tsx
Your Example Website or App
https://codesandbox.io/s/affectionate-leftpad-vv1tnl?file=/src/app.tsx
Steps to Reproduce the Bug or Issue
如上
Expected behavior
可以先构建parent,有需要的时候,再加入到画布上
Screenshots or Videos
No response
Platform
- OS: MacOS
- Browser: Chrome
- Version: 102.0.5005.61
Additional context
No response
👋 @fanmingfei
Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.
We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
这个问题不好解决吗?同样遇到了这个问题,请问有替代的临时解决方案不?
@TommyCat008 先添加完子节点,再 addChild 就不会有问题。
把子节点移动到最前面,Cell.toFront()