chore(examples): update examples with new API for add/remove
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -31,7 +31,9 @@ onNodeDragStop(({ node }) => {
|
||||
<template>
|
||||
<div class="vue-flow__group-node">
|
||||
<Handle type="target" :position="Position.Top" />
|
||||
|
||||
<strong>Group {{ label }}</strong>
|
||||
|
||||
<Handle type="source" :position="Position.Bottom" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -73,21 +73,19 @@ const { onConnect, addEdges, addNodes, findNode } = useVueFlow({
|
||||
],
|
||||
})
|
||||
|
||||
onConnect((params) => addEdges([params]))
|
||||
onConnect(addEdges)
|
||||
|
||||
onMounted(() => {
|
||||
// add nodes to parent
|
||||
addNodes([
|
||||
{
|
||||
id: '999',
|
||||
type: 'input',
|
||||
label: 'Added after mount',
|
||||
position: { x: 20, y: 100 },
|
||||
class: 'light',
|
||||
expandParent: true,
|
||||
parentNode: '2',
|
||||
},
|
||||
])
|
||||
addNodes({
|
||||
id: '999',
|
||||
type: 'input',
|
||||
label: 'Added after mount',
|
||||
position: { x: 20, y: 100 },
|
||||
class: 'light',
|
||||
expandParent: true,
|
||||
parentNode: '2',
|
||||
})
|
||||
|
||||
setTimeout(() => {
|
||||
const node = findNode('999')!
|
||||
|
||||
Reference in New Issue
Block a user