docs: update examples

This commit is contained in:
bcakmakoglu
2022-06-07 18:33:00 +02:00
committed by Braks
parent 58783fd4a1
commit 3a225a6871
5 changed files with 22 additions and 24 deletions
+3 -3
View File
@@ -7,7 +7,7 @@ import { initialElements } from './initial-elements.js'
* useVueFlow provides all event handlers and store properties
* You can pass the composable an object that has the same properties as the VueFlow component props
*/
const { onPaneReady, onNodeDragStop, onConnect, instance, addEdges } = useVueFlow()
const { onPaneReady, onNodeDragStop, onConnect, addEdges, setTransform, toObject } = useVueFlow()
/**
* Our elements
@@ -50,12 +50,12 @@ const updatePos = () =>
/**
* toObject transforms your current graph data to an easily persist-able object
*/
const logToObject = () => console.log(instance.value?.toObject())
const logToObject = () => console.log(toObject())
/**
* Resets the current viewpane transformation (zoom & pan)
*/
const resetTransform = () => instance.value?.setTransform({ x: 0, y: 0, zoom: 1 })
const resetTransform = () => setTransform({ x: 0, y: 0, zoom: 1 })
const toggleClass = () => {
dark.value = !dark.value