From 20d18eeed206211c97dad99df86cecc22f88fa2c Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Thu, 13 Jun 2024 23:00:26 +0200 Subject: [PATCH] docs: update config page --- docs/src/guide/vue-flow/config.md | 295 +++++++++++++++++++----------- 1 file changed, 191 insertions(+), 104 deletions(-) diff --git a/docs/src/guide/vue-flow/config.md b/docs/src/guide/vue-flow/config.md index 33d45c4b..0405e31d 100644 --- a/docs/src/guide/vue-flow/config.md +++ b/docs/src/guide/vue-flow/config.md @@ -61,38 +61,6 @@ const toggleNodesDraggable = () => { It is used for the lookup and injection of the state instance. -### modelValue (optional) - -- Type: [`Elements`](/typedocs/types/Elements) - -- Details: - - An array of elements (nodes + edges). - - Use either the modelValue prop or nodes/edges separately. __Do not mix them!__ - -- Example: - -```vue - - -``` - ### nodes (optional) - Type: [`Node[]`](/typedocs/interfaces/Node) @@ -107,19 +75,36 @@ const elements = ref([ ```vue ``` @@ -140,21 +125,77 @@ const nodes = ref([ import { VueFlow } from '@vue-flow/core' const nodes = ref([ + { + id: '1', + type: 'input', + position: { x: 250, y: 5 }, + data: { label: 'Node 1' }, + }, + { + id: '2', + position: { x: 100, y: 100 }, + data: { label: 'Node 2' }, + }, + { + id: '3', + position: { x: 400, y: 100 }, + data: { label: 'Node 3' }, + }, + { + id: '4', + type: 'output', + position: { x: 400, y: 200 }, + data: { label: 'Node 4' }, + }, +]) + +const edges = ref([ + { + id: 'e1->3', + source: '1', + target: '3' + }, + { + id: 'e1->2', + source: '1', + target: '2', + }, +]) + + +``` + +### modelValue (optional) (deprecated) + +- Type: [`Elements`](/typedocs/types/Elements) + +- Details: + + An array of elements (nodes + edges). + + Use either the modelValue prop or nodes/edges separately. __Do not mix them!__ + +- Example: + +```vue + + ``` @@ -172,6 +213,7 @@ const edges = ref([ ```vue ``` @@ -209,6 +258,7 @@ const edges = ref([ ```vue ``` @@ -245,25 +307,13 @@ const edges = ref([ If you want to have full control of state changes, you can disable the default behavior and apply your own change handlers to the state. + Check the [controlled flow](/guide/controlled-flow) guide for more information. + - Example: ```vue - ``` @@ -523,17 +573,26 @@ const edges = ref([ - Example: -```vue{5-6,10} +```vue + ``` @@ -551,17 +610,26 @@ const elements = ref([ - Example: -```vue{5-6,10} +```vue + ``` @@ -586,17 +654,23 @@ const elements = ref([ - Example: -```vue{5-6} +```vue + ``` @@ -648,19 +722,30 @@ const elements = ref([ - Example: -```vue{7-8,12} +```vue ``` @@ -706,7 +791,7 @@ const elements = ref([ Does not work for the `addEdge` utility! -### auto-connect (optional) +### auto-connect (optional) (deprecated) - Type: `boolean` | [`Connector`](/typedocs/types/Connector) @@ -733,11 +818,13 @@ const elements = ref([ #### [Connector](/typedocs/types/Connector) -```vue{6-18,22} +```vue ```