possible bug with removeNodes()
or its v-model
#453
-
Hello, I think I discovered a bug with So in our use case, we use GUID as Id and when I delete the last Node and then add a new Node, it adds 2 Nodes to the canvas instead of 1 as it's supposed to do because the last node in still somehow in memory App.vue<script lang="ts" setup>
import { VueFlow } from '@vue-flow/core'
import { ref, watch } from 'vue'
import SaveRestoreControls from './Controls.vue'
const elements = ref([{ id: '1', label: 'Node 1', position: { x: 100, y: 100 } }])
// NEW: adding a value count & display it below
const count = ref(1)
watch(elements, (newValue) => {
count.value = newValue.length;
})
</script>
<template>
Elements count: {{count}}
<VueFlow v-model="elements">
<SaveRestoreControls />
</VueFlow>
</template>
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 13 replies
-
Did you check if the element is actually still in the state? (like logging Try watching it deeply, i.e. |
Beta Was this translation helpful? Give feedback.
-
The fix is released with |
Beta Was this translation helpful? Give feedback.
The fix is released with
1.5.1
@ghiscoding