update(examples): correct examples

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-12-20 19:29:52 +01:00
parent 994dd9929c
commit 5139b0786b
28 changed files with 169 additions and 615 deletions
+2 -3
View File
@@ -1,5 +1,5 @@
<script lang="ts" setup>
import { VueFlow, Background, Connection, Elements, Edge, removeElements, addEdge } from '~/index'
import { VueFlow, Background, Connection, Elements, Edge, addEdge } from '~/index'
const initialElements: Elements = [
{ id: '1', type: 'input', data: { label: 'Node 1' }, position: { x: 250, y: 5 }, class: 'light' },
{ id: '2', data: { label: 'Node 2' }, position: { x: 100, y: 100 }, class: 'light' },
@@ -11,10 +11,9 @@ const initialElements: Elements = [
const elements = ref<Elements>(initialElements)
const onConnect = (params: Connection | Edge) => (elements.value = addEdge(params, elements.value))
const onElementsRemove = (elementsToRemove: Elements) => (elements.value = removeElements(elementsToRemove, elements.value))
</script>
<template>
<VueFlow v-model="elements" @elements-remove="onElementsRemove" @connect="onConnect">
<VueFlow v-model="elements" @connect="onConnect">
<Background />
</VueFlow>
</template>