diff --git a/examples/CustomNode/ColorSelectorNode.vue b/examples/CustomNode/ColorSelectorNode.vue index a43e567c..a0823f2f 100644 --- a/examples/CustomNode/ColorSelectorNode.vue +++ b/examples/CustomNode/ColorSelectorNode.vue @@ -25,13 +25,11 @@ const sourceHandleStyleB: CSSProperties = { ...targetHandleStyle, bottom: '10px' const onConnect = (params: Connection | Edge) => console.log('handle onConnect', params) diff --git a/examples/CustomNode/CustomNode.vue b/examples/CustomNode/CustomNode.vue index 5400a417..be4a5c82 100644 --- a/examples/CustomNode/CustomNode.vue +++ b/examples/CustomNode/CustomNode.vue @@ -63,7 +63,7 @@ onMounted(() => { { id: '1', type: 'input', - data: { label: 'An input node' }, + label: 'An input node', position: { x: 0, y: 50 }, sourcePosition: Position.Right, }, @@ -77,14 +77,14 @@ onMounted(() => { { id: '3', type: 'output', - data: { label: 'Output A' }, + label: 'Output A', position: { x: 650, y: 25 }, targetPosition: Position.Left, }, { id: '4', type: 'output', - data: { label: 'Output B' }, + label: 'Output B', position: { x: 650, y: 100 }, targetPosition: Position.Left, }, diff --git a/examples/EdgeWithButton/ButtonEdge.vue b/examples/EdgeWithButton/ButtonEdge.vue index 879092ea..ef213a4a 100644 --- a/examples/EdgeWithButton/ButtonEdge.vue +++ b/examples/EdgeWithButton/ButtonEdge.vue @@ -17,7 +17,7 @@ interface CustomEdgeProps extends EdgeProps { const props = defineProps() const store = useVueFlow() const onEdgeClick = (evt: Event, id: string) => { - const edge = store.getEdges.find((edge) => edge.id === id) + const edge = store.getEdge(id) if (edge) { store.hooks.elementsRemove.trigger([edge]) } diff --git a/examples/Empty/EmptyExample.vue b/examples/Empty/EmptyExample.vue index 5d5ce58a..5bae2491 100644 --- a/examples/Empty/EmptyExample.vue +++ b/examples/Empty/EmptyExample.vue @@ -29,10 +29,10 @@ const addRandomNode = () => { const nodeId = (elements.value.length + 1).toString() const newNode: Node = { id: nodeId, - data: { label: `Node: ${nodeId}` }, + label: `Node: ${nodeId}`, position: { x: Math.random() * window.innerWidth, y: Math.random() * window.innerHeight }, } as Node - elements.value = [...elements.value, newNode] + elements.value.push(newNode) }