feat: Add suspensions to node, noderenderer and around zoom-pane

* bind zoompanhelper functions to zoom-pane slot

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-11-18 14:08:46 +01:00
parent 54dfd8498b
commit 14980e38b7
4 changed files with 118 additions and 98 deletions
+15 -13
View File
@@ -48,18 +48,20 @@ const selected = (nodeId: string) => store.selectedElements?.some(({ id }) => id
</script>
<template>
<div class="vue-flow__nodes" :style="{ transform }">
<template v-for="node of nodes" :key="node.id">
<Node
:node="node"
:type="type(node)"
:snap-grid="snapGrid"
:select-nodes-on-drag="props.selectNodesOnDrag"
:selected="selected(node.id)"
>
<template #default="nodeProps">
<slot :name="`node-${node.type}`" v-bind="nodeProps"></slot>
</template>
</Node>
</template>
<Suspense>
<template v-for="node of nodes" :key="node.id">
<Node
:node="node"
:type="type(node)"
:snap-grid="snapGrid"
:select-nodes-on-drag="props.selectNodesOnDrag"
:selected="selected(node.id)"
>
<template #default="nodeProps">
<slot :name="`node-${node.type}`" v-bind="nodeProps"></slot>
</template>
</Node>
</template>
</Suspense>
</div>
</template>