diff --git a/docs/components/DocsRepl.vue b/docs/components/DocsRepl.vue index eac2cbfe..58eb8726 100644 --- a/docs/components/DocsRepl.vue +++ b/docs/components/DocsRepl.vue @@ -49,7 +49,7 @@ watchEffect(() => { vh.value = `${window.innerHeight}px` }) -const files: Record = {} +const files: Record = {} const imports = exampleImports[props.example] const additionalImports = 'additionalImports' in imports ? imports.additionalImports : {} diff --git a/docs/components/examples/basic/App.vue b/docs/components/examples/basic/App.vue index dd2c53b4..43b56ad9 100644 --- a/docs/components/examples/basic/App.vue +++ b/docs/components/examples/basic/App.vue @@ -40,8 +40,8 @@ const dark = ref(false) * To update node properties you can simply use your elements v-model and mutate the elements directly * Changes should always be reflected on the graph reactively, without the need to overwrite the elements */ -const updatePos = () => - elements.value.forEach((el) => { +function updatePos() { + return elements.value.forEach((el) => { if (isNode(el)) { el.position = { x: Math.random() * 400, @@ -49,18 +49,25 @@ const updatePos = () => } } }) +} /** * toObject transforms your current graph data to an easily persist-able object */ -const logToObject = () => console.log(toObject()) +function logToObject() { + return console.log(toObject()) +} /** * Resets the current viewpane transformation (zoom & pan) */ -const resetTransform = () => setTransform({ x: 0, y: 0, zoom: 1 }) +function resetTransform() { + return setTransform({ x: 0, y: 0, zoom: 1 }) +} -const toggleClass = () => (dark.value = !dark.value) +function toggleClass() { + return (dark.value = !dark.value) +}