regression(nodes,edges): removing nodes/edges breaks renderer

This commit is contained in:
Braks
2022-04-04 21:42:48 +02:00
parent 0bfca93a7b
commit 528cac5d33
4 changed files with 20 additions and 20 deletions
+3 -3
View File
@@ -1,13 +1,14 @@
<script lang="ts" setup>
import { DraggableEventListener, DraggableCore } from '@braks/revue-draggable/src/index'
import { useVueFlow } from '../../composables'
import { SnapGrid } from '../../types'
import { GraphNode, SnapGrid } from '../../types'
import { NodeId } from '../../context'
import { getXYZPos } from '../../utils'
interface NodeWrapperProps {
id: string
name: string
node: GraphNode
draggable: boolean
selectable: boolean
connectable: boolean
@@ -16,8 +17,7 @@ interface NodeWrapperProps {
const props = defineProps<NodeWrapperProps>()
const { store } = useVueFlow()
const node = computed(() => store.getNode(props.id)!)
if (!node.value) throw new Error(`[vueflow]: Node with ${props.id} not found!`)
const node = useVModel(props, 'node')
provide(NodeId, props.id)
const nodeElement = templateRef<HTMLDivElement>('node-element', null)