chore: update README example
This commit is contained in:
23
README.md
23
README.md
@@ -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>
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user