Prevent nodes from being removed #275
Answered
by
bcakmakoglu
rubenduiveman
asked this question in
Q&A
-
I have a use case where I want to prevent some nodes from being removed. I'd like to be able to "lock" a node by setting a property like |
Beta Was this translation helpful? Give feedback.
Answered by
bcakmakoglu
Aug 23, 2022
Replies: 1 comment 1 reply
-
I see, that could be added at some point. <script setup>
const { applyNodeChanges, onNodesChange } = useVueFlow()
onNodesChange((changes) => {
const nextChanges = changes.filter((change) => {
if (change.type === 'remove') {
// block removing
}
})
applyNodeChanges(nextChanges)
})
</script>
<template>
<div style="height: 300px">
<VueFlow :apply-default="false" />
</div> |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
bcakmakoglu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I see, that could be added at some point.
For now you can hook into the apply changes process and stop the deletion of nodes if necessary.