chore(docs): cleanup examples

This commit is contained in:
braks
2024-02-05 07:51:12 +01:00
committed by Braks
parent 034885062c
commit 24c2091c7a
13 changed files with 141 additions and 159 deletions
+6 -8
View File
@@ -3,7 +3,7 @@ import { ref } from 'vue'
import { Position, VueFlow, useVueFlow } from '@vue-flow/core'
import TransitionEdge from './TransitionEdge.vue'
const elements = ref([
const nodes = ref([
{
id: '1',
type: 'input',
@@ -18,21 +18,19 @@ const elements = ref([
position: { x: 1000, y: 1000 },
targetPosition: Position.Left,
},
{ id: 'e1-2', type: 'custom', source: '1', target: '2', animated: true, style: { stroke: '#fff' } },
])
const edges = ref([{ id: 'e1-2', type: 'custom', source: '1', target: '2', animated: true, style: { stroke: '#fff' } }])
const { onPaneReady } = useVueFlow()
onPaneReady((i) => {
i.fitView({
nodes: ['1'],
})
onPaneReady(({ fitView }) => {
fitView({ nodes: ['1'] })
})
</script>
<template>
<VueFlow v-model="elements" :style="{ backgroundColor: '#1A192B' }">
<VueFlow :nodes="nodes" :edges="edges" :style="{ backgroundColor: '#1A192B' }">
<template #edge-custom="props">
<TransitionEdge v-bind="props" />
</template>
+1 -1
View File
@@ -1,7 +1,7 @@
<script setup>
import { computed, ref } from 'vue'
import { TransitionPresets, useDebounceFn, useTransition, watchDebounced } from '@vueuse/core'
import { getBezierPath, useVueFlow } from '@vue-flow/core'
import { computed, ref } from 'vue'
const props = defineProps({
id: {