refactor(core): search all edges for connected edges in useNode
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -11,7 +11,7 @@ export default function useNode<Data = ElementData, CustomEvents extends Record<
|
|||||||
const nodeId = id ?? inject(NodeId, '')
|
const nodeId = id ?? inject(NodeId, '')
|
||||||
const nodeEl = inject(NodeRef, null)
|
const nodeEl = inject(NodeRef, null)
|
||||||
|
|
||||||
const { findNode, getEdges, emits } = useVueFlow()
|
const { findNode, edges, emits } = useVueFlow()
|
||||||
|
|
||||||
const node = findNode<Data, CustomEvents>(nodeId)!
|
const node = findNode<Data, CustomEvents>(nodeId)!
|
||||||
|
|
||||||
@@ -24,6 +24,6 @@ export default function useNode<Data = ElementData, CustomEvents extends Record<
|
|||||||
nodeEl,
|
nodeEl,
|
||||||
node,
|
node,
|
||||||
parentNode: computed(() => (node.parentNode ? findNode(node.parentNode) : undefined)),
|
parentNode: computed(() => (node.parentNode ? findNode(node.parentNode) : undefined)),
|
||||||
connectedEdges: computed(() => getConnectedEdges([node], getEdges.value)),
|
connectedEdges: computed(() => getConnectedEdges([node], edges.value)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user