Skip to Content
Vue Flow v2 is here and joins xyflow! Read more here →
ReferenceComposables

useEdgesData()

Source on GitHub 

The useEdgesData composable returns the data of one or more edges by id, along with each edge’s id and type. Like useNodesData(), it is shallow-compared and only re-runs when the referenced edges’ data changes.

<script setup lang="ts"> import { useEdgesData } from '@xyflow/vue'; const edgeData = useEdgesData('edge-1'); const many = useEdgesData(['edge-1', 'edge-2']); </script>

Signature

Parameters:
NameTypeDefault
edgeIdMaybeRefOrGetter<string>

The id (or ids) of the edge to get the data from

Returns:
ComputedRef<EdgeData<EdgeType> | null>

An object (or array of objects) with id, type, data representing each edge

Notes

  • Pass a single id to get an object (or null); pass an array to get an array.
  • The result is read-only.