diff --git a/docs/src/guide/node.md b/docs/src/guide/node.md index 2ab9809d..4e8d0b33 100644 --- a/docs/src/guide/node.md +++ b/docs/src/guide/node.md @@ -649,6 +649,77 @@ User-created nodes don't have any default styles associated and thus need custom } ``` +## Updating Node Data + +Since nodes are reactive object, you can update their data at any point by simply mutating it. +This allows you to disable or enable handles, 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 [useNode] + + +``` + +```ts [useVueFlow] +import { useVueFlow } from '@vue-flow/core' + +const instance = useVueFlow() + +// find the node in the state by its id +const node = instance.findNode(nodeId) + +node.data = { + ...node.data, + hello: 'world', +} +``` + +```vue [v-model] + + + +``` + +::: + ## Implementing Scrolling within Nodes Sometimes, a node might contain a large amount of content, making it difficult for users to view everything without the aid of a scroll function.