chore(docs): cleanup examples
This commit is contained in:
@@ -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,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: {
|
||||
|
||||
Reference in New Issue
Block a user