chore(docs): cleanup layouting example

This commit is contained in:
braks
2024-02-07 22:42:42 +01:00
parent a99c620b18
commit dc8faecd8c
3 changed files with 11 additions and 7 deletions
+9 -5
View File
@@ -1,5 +1,5 @@
<script setup>
import { computed, ref, toRef, watch } from 'vue'
import { computed, nextTick, ref, toRef, watch } from 'vue'
import { BaseEdge, EdgeLabelRenderer, Position, getSmoothStepPath, useNodesData } from '@vue-flow/core'
import { TransitionPresets, executeTransition } from '@vueuse/core'
@@ -94,9 +94,11 @@ watch(isFinished, async (isFinished) => {
if (isFinished) {
await runAnimation()
edgePoint.value = 0
currentLength.value = 0
labelPosition.value = { x: 0, y: 0 }
nextTick(() => {
edgePoint.value = 0
currentLength.value = 0
labelPosition.value = { x: 0, y: 0 }
})
}
})
@@ -107,7 +109,9 @@ async function runAnimation() {
return
}
isAnimating.value = true
nextTick(() => {
isAnimating.value = true
})
const totalLength = pathEl.getTotalLength()