chore: update README example

This commit is contained in:
braks
2024-04-16 16:17:57 +02:00
parent 11229e4dc4
commit 1f1792bd09

View File

@@ -82,29 +82,20 @@ Nodes additionally need an __XY-position__, while edges require a __source__ and
import { VueFlow } from '@vue-flow/core'
const nodes = ref([
{
id: '1',
label: 'node 1',
position: {x: 100, y: 100},
},
{
id: '2',
label: 'node 2',
position: {x: 100, y: 200},
},
{ id: '1', type: 'input', label: 'Node 1', position: { x: 250, y: 5 } },
{ id: '2', label: 'Node 2', position: { x: 100, y: 100 } },
{ id: '3', label: 'Node 3', position: { x: 400, y: 100 } },
{ id: '4', label: 'Node 4', position: { x: 400, y: 200 } },
])
const edges = ref([
{
id: 'e1-2',
target: '2',
source: '1',
},
{ id: 'e1-2', source: '1', target: '2', animated: true },
{ id: 'e1-3', source: '1', target: '3' },
])
</script>
<template>
<VueFlow :nodes="nodes" :edges="edges"></VueFlow>
<VueFlow v-model:nodes="nodes" v-model:edges="edges"></VueFlow>
</template>
```