Skip to content

@vue-flow/monorepoDocs


Function: useNode()

useNode<Data, CustomEvents>(id?): object

Composable that provides access to a node object, parent node object, connected edges and it's dom element

If no node id is provided, the node id is injected from context

If you do not provide an id, this composable has to be called in a child of your custom node component, or it will throw

Type Parameters

Data = any

CustomEvents extends Record<string, CustomEvent> = any

Parameters

id?: string

The id of the node to access

Returns

object

the node id, the node, the node dom element, it's parent and connected edges

connectedEdges

connectedEdges: ComputedRef<GraphEdge[]>

id

id: string = nodeId

node

node: GraphNode<Data, CustomEvents, string>

nodeEl

nodeEl: Ref<null | HTMLDivElement>

parentNode

parentNode: ComputedRef<undefined | GraphNode<any, any, string>>

VueFlow v1.42 中文网 - 粤ICP备13048890号