From 78c58688a2747b830768bd21ce2619b91a866c7e Mon Sep 17 00:00:00 2001 From: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com> Date: Wed, 9 Feb 2022 16:39:35 +0100 Subject: [PATCH] feat(examples): Add OptionsAPI example Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com> --- examples/Basic/Basic.vue | 6 +-- examples/Basic/BasicOptionsAPI.vue | 74 ++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 3 deletions(-) create mode 100644 examples/Basic/BasicOptionsAPI.vue diff --git a/examples/Basic/Basic.vue b/examples/Basic/Basic.vue index 7f392d64..90b13dfc 100644 --- a/examples/Basic/Basic.vue +++ b/examples/Basic/Basic.vue @@ -9,7 +9,7 @@ const elements = ref([ { id: 'e1-2', source: '1', target: '2', animated: true }, { id: 'e1-3', source: '1', target: '3' }, ]) -const { nodes, onPaneReady, onNodeDragStop, onConnect, instance, addEdges, store } = useVueFlow() +const { onPaneReady, onNodeDragStop, onConnect, instance, addEdges } = useVueFlow() onPaneReady(({ fitView }) => { fitView({ padding: 0.1 }) }) @@ -28,7 +28,7 @@ const updatePos = () => const logToObject = () => console.log(instance.value?.toObject()) const resetTransform = () => elements.value.push({ id: '1234', position: { x: 50, y: 50 }, label: 'Foobar' }) -const toggleclasss = () => elements.value.forEach((el) => (el.class = el.class === 'light' ? 'dark' : 'light')) +const toggleclass = () => elements.value.forEach((el) => (el.class = el.class === 'light' ? 'dark' : 'light'))