diff --git a/docs/src/guide/components/background.md b/docs/src/guide/components/background.md index 51e24497..e3e1242b 100644 --- a/docs/src/guide/components/background.md +++ b/docs/src/guide/components/background.md @@ -19,14 +19,10 @@ To use the background simply pass the `Background` component as a child to the ` diff --git a/docs/src/guide/components/controls.md b/docs/src/guide/components/controls.md index e9f499e1..c40b9aba 100644 --- a/docs/src/guide/components/controls.md +++ b/docs/src/guide/components/controls.md @@ -26,16 +26,10 @@ import { Controls } from '@vue-flow/controls' // import default controls styles import '@vue-flow/controls/dist/style.css' - -import initialElements from './initial-elements' - - -// some nodes and edges -const elements = ref(initialElements) diff --git a/docs/src/guide/components/minimap.md b/docs/src/guide/components/minimap.md index a0721ffd..ea538163 100644 --- a/docs/src/guide/components/minimap.md +++ b/docs/src/guide/components/minimap.md @@ -24,15 +24,10 @@ import { MiniMap } from '@vue-flow/minimap' // import default minimap styles import '@vue-flow/minimap/dist/style.css' - -import initialElements from './initial-elements' - -// some nodes and edges -const elements = ref(initialElements) diff --git a/docs/src/guide/components/node-resizer.md b/docs/src/guide/components/node-resizer.md index ac37a83f..2eb3bd10 100644 --- a/docs/src/guide/components/node-resizer.md +++ b/docs/src/guide/components/node-resizer.md @@ -16,17 +16,18 @@ npm install @vue-flow/node-resizer ```vue @@ -40,14 +41,13 @@ import { NodeResizer } from '@vue-flow/node-resizer' // make sure to include the necessary styles! import '@vue-flow/node-resizer/dist/style.css' -defineProps(['label']) +defineProps(['data']) ``` diff --git a/docs/src/guide/components/node-toolbar.md b/docs/src/guide/components/node-toolbar.md index 9c03675d..2f36a068 100644 --- a/docs/src/guide/components/node-toolbar.md +++ b/docs/src/guide/components/node-toolbar.md @@ -19,16 +19,16 @@ npm install @vue-flow/node-toolbar ```vue @@ -59,10 +59,6 @@ defineProps() -
- {{ label }} -
- diff --git a/docs/src/guide/theming.md b/docs/src/guide/theming.md index 82e23227..a011cfa8 100644 --- a/docs/src/guide/theming.md +++ b/docs/src/guide/theming.md @@ -91,9 +91,10 @@ Below are a couple of examples on how you can do this: Directly styling the Vue Flow component: -```vue{3-4} +```vue{4-5} @@ -108,8 +109,8 @@ Styling nodes/edges with a style or class attribute: const nodes = ref([ { id: '1', - label: 'Node 1', position: { x: 250, y: 5 }, + data: { label: 'Node 1' }, // Add a class name to the node class: 'my-custom-node-class', @@ -140,11 +141,11 @@ These alterations can be implemented either on a global scale or to individual e ``` ```js{6-7} [] -const elements = ref([ +const nodes = ref([ { id: '1', - label: 'Node 1', position: { x: 100, y: 100 }, + data: { label: 'Node 1' }, /* Overriding the `--vf-node-color` variable to change node border, box-shadow and handle color */ style: { '--vf-node-color': 'blue' } }, diff --git a/docs/src/guide/troubleshooting.md b/docs/src/guide/troubleshooting.md index 10016439..7b790189 100644 --- a/docs/src/guide/troubleshooting.md +++ b/docs/src/guide/troubleshooting.md @@ -18,7 +18,7 @@ Vue Flow can emit several error types to help diagnose and resolve issues. ``` diff --git a/docs/src/guide/utils/graph.md b/docs/src/guide/utils/graph.md index d599bda3..f6e27dbf 100644 --- a/docs/src/guide/utils/graph.md +++ b/docs/src/guide/utils/graph.md @@ -13,8 +13,8 @@ import { VueFlow, isEdge } from '@vue-flow/core' const elements = ref([ - { id: '1', label: 'Node 1', position: { x: 250, y: 5 }, }, - { id: '2', label: 'Node 2', position: { x: 100, y: 100 }, }, + { id: '1', position: { x: 250, y: 5 }, }, + { id: '2', position: { x: 100, y: 100 }, }, { id: 'e1-2', source: '1', target: '2', class: 'light' }, ]) @@ -27,9 +27,10 @@ const toggleClass = () => { }) } + ``` @@ -61,33 +62,34 @@ const toggleClass = () => { }) } + ``` -## [addEdge](/typedocs/functions/isEdge) +## [addEdge](/typedocs/functions/isEdge) (deprecated) ::: warning -In the composition API you should use [`addEdges`](/typedocs/types/AddEdges) -of [`useVueFlow`](/guide/composables#usevueflow/) +In the composition API you should use [`addEdges`](/typedocs/types/AddEdges) of [`useVueFlow`](/guide/composables#usevueflow/) ::: - Details: - Confirms if an element is a node. + Adds an edge to the elements array. - Example: ```vue{12}