父子关系
此示例演示了如何在节点之间动态创建父子关系。你可以将一个节点拖动到一个组节点上,将其作为子节点附加,并使用工具栏的“分离”按钮将其移除。实现处理了将绝对位置转换为父节点相对坐标时所需的复杂位置计算。
🌐 This example demonstrates how to dynamically create parent-child relationships between nodes. You can drag a node over a group node to attach it as a child, and use the toolbar’s “detach” button to remove it. The implementation handles the complex position calculations needed when transforming absolute positions to parent-relative coordinates.
This is a Pro example. Get all pro examples, templates, 1:1 support from the xyflow team and prioritized Github issues with a React Flow Pro subscription.
关于此 Pro 示例
🌐 About this Pro Example
- 依赖: @xyflow/react
- 许可证:xyflow Pro 许可证
Last updated on