useEdgesData()
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:
Returns:
| Name | Type | Default |
|---|---|---|
edgeId | MaybeRefOrGetter<string>The id (or ids) of the edge to get the data from |
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.