fix: replace store id with flow id

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-12-20 19:29:52 +01:00
parent f8a23c59ec
commit 600e3866c4
8 changed files with 24 additions and 34 deletions
+4 -4
View File
@@ -23,7 +23,7 @@ const props = withDefaults(defineProps<FlowProps>(), {
const emit = defineEmits([...Object.keys(createHooks()), 'update:modelValue', 'update:edges', 'update:nodes'])
const { modelValue, nodes, edges } = useVModels(props, emit)
const { store } = useVueFlow(props)
const { id, store } = useVueFlow(props)
useHooks(store.hooks, emit)
onMounted(() => useWatch(modelValue, nodes, edges, props, store))
@@ -38,18 +38,18 @@ export default {
</script>
<template>
<div class="vue-flow">
<ZoomPane :key="`renderer-${store.id}`">
<ZoomPane :key="`renderer-${id}`">
<template
v-for="nodeName of Object.keys(store.getNodeTypes)"
#[`node-${nodeName}`]="nodeProps"
:key="`node-${nodeName}-${store.id}`"
:key="`node-${nodeName}-${id}`"
>
<slot :name="`node-${nodeName}`" v-bind="nodeProps" />
</template>
<template
v-for="edgeName of Object.keys(store.getEdgeTypes)"
#[`edge-${edgeName}`]="edgeProps"
:key="`edge-${edgeName}-${store.id}`"
:key="`edge-${edgeName}-${id}`"
>
<slot :name="`edge-${edgeName}`" v-bind="edgeProps" />
</template>