update(examples): fix 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 8118325d4e
commit 69dc45c3be
8 changed files with 25 additions and 57 deletions
@@ -7,14 +7,6 @@ interface ColorSelectorNodeProps extends NodeProps {
color: string
onChange: (event: any) => void
}
type: string
selected?: boolean
connectable?: boolean
xPos?: number
yPos?: number
targetPosition?: Position
sourcePosition?: Position
dragging?: boolean
}
const props = defineProps<ColorSelectorNodeProps>()
+3 -17
View File
@@ -3,19 +3,16 @@ import ColorSelectorNode from './ColorSelectorNode.vue'
import {
VueFlow,
isEdge,
addEdge,
MiniMap,
Controls,
Node,
FlowElement,
FlowInstance,
Elements,
Position,
SnapGrid,
Connection,
ConnectionMode,
Edge,
useVueFlow,
useNodesState,
} from '~/index'
const elements = ref<Elements>([])
@@ -89,23 +86,12 @@ onMounted(() => {
]
})
const { useNodesState, OnPaneReady, OnNodeDragStop, OnConnect } = useVueFlow()
useNodesState(undefined, true)
const { OnPaneReady } = useVueFlow()
useNodesState()
OnPaneReady((flowInstance) => {
flowInstance.fitView()
console.log('flow loaded:', flowInstance)
})
OnNodeDragStop(({ node }) => console.log('drag stop', node))
OnConnect((params) =>
addEdge(
{
...params,
animated: true,
style: { stroke: '#fff' },
} as Edge,
elements.value,
),
)
</script>
<template>
<VueFlow