Modify node properties from CustomNode component #920
-
Hi, I don't know if it's a lack of Vue3 knowledge, but I can't seem to find an easy way to mutate the node object properties (specifically, in the example, the label) from my custom node component. I know I can do it by the usual propagation event, I was just wondering if there is a faster or better way. The parent component:
The child component:
I tried with a single Thanks for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Props are immutable (this is imposed by Vue, not Vue Flow) but what you can do is something like this // inside your custom node component
const { node } = useNode()
function changeNodeLabel(label: string) {
node.label = label
} |
Beta Was this translation helpful? Give feedback.
Props are immutable (this is imposed by Vue, not Vue Flow) but what you can do is something like this