feat(docs): add animation edge to layouting example

This commit is contained in:
braks
2024-02-07 22:29:40 +01:00
committed by Braks
parent 43a1c9d2ac
commit 75355b04e7
6 changed files with 157 additions and 117 deletions
+13 -3
View File
@@ -4,6 +4,7 @@ import { nextTick, ref } from 'vue'
import { Panel, Position, VueFlow, useVueFlow } from '@vue-flow/core'
import { Background } from '@vue-flow/background'
import ProcessNode from './ProcessNode.vue'
import AnimationEdge from './AnimationEdge.vue'
import { initialEdges, initialNodes } from './initial-elements.js'
import { useRunProcess } from './useRunProcess'
@@ -62,11 +63,20 @@ function handleLayout(direction) {
<div class="layoutflow">
<VueFlow :nodes="nodes" :edges="edges" @nodes-initialized="handleLayout('LR')">
<template #node-process="props">
<ProcessNode v-bind="props" />
<ProcessNode :data="props.data" :source-position="props.sourcePosition" :target-position="props.targetPosition" />
</template>
<template #edge-animation="props">
<AnimationEdge v-bind="props" />
<template #edge-animation="edgeProps">
<AnimationEdge
:id="edgeProps.id"
:source="edgeProps.source"
:source-x="edgeProps.sourceX"
:source-y="edgeProps.sourceY"
:targetX="edgeProps.targetX"
:targetY="edgeProps.targetY"
:source-position="edgeProps.sourcePosition"
:target-position="edgeProps.targetPosition"
/>
</template>
<Background />