父子关系
本示例演示了如何在节点之间动态创建父子关系。你可以将节点拖到组节点上,将其作为子节点附加,然后使用工具栏的 “detach” 按钮将其移除。该实现处理了将绝对位置转换为父级相对坐标时所需的复杂位置计算。
¥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
-
¥Dependencies: @xyflow/react
-
许可证:xyflow 专业版许可证
¥License: xyflow Pro License
Last updated on