You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This guide covers the basics of setting up and using Vue Flow. You'll learn how to install Vue Flow, configure it, and
13
-
utilize it within your own projects.
12
+
This guide covers the basics of setting up and using Vue Flow.
13
+
You'll learn how to install Vue Flow, configure it, and create your first flowchart.
14
14
15
15
## Prerequisites
16
16
@@ -45,86 +45,118 @@ $ yarn add @vue-flow/core
45
45
46
46
## Usage
47
47
48
-
In Vue Flow, an application structure consists of [**nodes**](/typedocs/interfaces/Node)
49
-
and [**edges**](/typedocs/types/Edge), all of which are categorised as [**elements**](/typedocs/types/Elements).
48
+
In Vue Flow, a graph consists of [**nodes**](/typedocs/interfaces/Node)and [**edges**](/typedocs/types/Edge), all of which are categorised as [**elements**](/typedocs/types/Elements).
50
49
51
-
**Each element requires a unique id.**
50
+
**Each node and edge requires a unique id.**
52
51
53
-
Nodes additionally need an [XY-position](/typedocs/interfaces/XYPosition), while edges require a source and a
54
-
target, both represented by node ids.
52
+
Nodes also need an [XY-position](/typedocs/interfaces/XYPosition), while edges require a `source` and a
53
+
`target`, both represented by node ids.
55
54
56
55
::: warning NOTE!
57
56
To ensure Vue Flow's is correctly displayed, make sure you include the necessary styles.
58
57
58
+
```css
59
+
/* these are necessary styles for vue flow */
60
+
@import'@vue-flow/core/dist/style.css';
61
+
62
+
/* this contains the default theme, these are optional styles */
63
+
@import'@vue-flow/core/dist/theme-default.css';
64
+
```
65
+
59
66
Refer to the [Theming](/guide/theming) section for additional information.
60
67
:::
61
68
62
-
Here's a simple Vue Flow example to get you started:
69
+
Here's a simple example to get you started:
63
70
64
71
::: code-group
65
72
66
73
```vue [<LogosJavascript />]
67
74
<script setup>
75
+
import { ref } from 'vue'
68
76
import { VueFlow } from '@vue-flow/core'
69
77
78
+
// these components are only shown as examples of how to use a custom node or edge
79
+
// you can find many examples of how to create these custom components in the examples page of the docs
70
80
import SpecialNode from './components/SpecialNode.vue'
71
81
import SpecialEdge from './components/SpecialEdge.vue'
72
82
73
-
const elements = ref([
74
-
// nodes
75
-
83
+
// these are our nodes
84
+
const nodes = ref([
76
85
// an input node, specified by using `type: 'input'`
0 commit comments