Skip to content

Commit 28b66a3

Browse files
committed
chore(core): add comments
1 parent e010497 commit 28b66a3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/core/src/container/VueFlow/VueFlow.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ const modelEdges = useVModel(props, 'edges', emit)
5353
5454
const { vueFlowRef, hooks, getNodeTypes, getEdgeTypes, ...rest } = useVueFlow(props)
5555
56+
// watch props and update store state
5657
const dispose = useWatchProps({ modelValue, nodes: modelNodes, edges: modelEdges }, props, {
5758
vueFlowRef,
5859
hooks,
@@ -63,9 +64,13 @@ const dispose = useWatchProps({ modelValue, nodes: modelNodes, edges: modelEdges
6364
6465
useHooks(emit, hooks)
6566
67+
// slots will be passed via provide
68+
// this is to avoid having to pass them down through all the components
69+
// as that would require a lot of boilerplate and causes significant performance drops
6670
provide(Slots, slots)
6771
6872
onUnmounted(() => {
73+
// clean up watcher scope
6974
dispose()
7075
})
7176
@@ -88,11 +93,11 @@ export default {
8893
<template>
8994
<div ref="vueFlowRef" class="vue-flow">
9095
<Viewport>
91-
<!-- This slot will be passed down to the transformation-pane and rendered inside there, meaning it's affected by zooming/panning -->
96+
<!-- This slot is affected by zooming & panning -->
9297
<slot name="zoom-pane" />
9398
</Viewport>
9499

95-
<!-- This slot will render outside the transformation-pane, meaning it's *not* affected by zooming and panning -->
100+
<!-- This slot is _not_ affected by zooming & panning -->
96101
<slot />
97102

98103
<A11yDescriptions />

0 commit comments

Comments
 (0)