diff --git a/docs/src/guide/edge.md b/docs/src/guide/edge.md index 22cb5a90..45dad5d9 100644 --- a/docs/src/guide/edge.md +++ b/docs/src/guide/edge.md @@ -678,3 +678,84 @@ const elements = ref([ ::: tip To override the styles of the default theme, visit the [Theming section](/guide/theming). ::: + +## Updating Edge Data + +Since edges are reactive object, you can update their data at any point by simply mutating it. +This allows you to change the label, or even add new properties to the data object at any point in time. + +There are multiple ways of achieving this, here are some examples: + +::: code-group + +```vue [useEdge] + + +``` + +```ts [useVueFlow] +import { useVueFlow } from '@vue-flow/core' + +const instance = useVueFlow() + +// find the node in the state by its id +const edge = instance.findEdge(edgeId) + +edge.data = { + ...edge.data, + hello: 'world', +} +``` + +```vue [v-model] + + + +``` + +:::