Skip to content

Commit 15ca63a

Browse files
committed
docs: update component documentation with new examples
Signed-off-by: braks <[email protected]>
1 parent f2eb883 commit 15ca63a

File tree

6 files changed

+49
-7
lines changed

6 files changed

+49
-7
lines changed

docs/src/guide/components/background.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,18 @@ npm install @vue-flow/background
1616
To use the background simply pass the `Background` component as a child to the `VueFlow` component.
1717

1818
```vue
19+
<script setup>
20+
import { VueFlow } from '@vue-flow/core'
21+
import { Background } from '@vue-flow/background'
22+
import initialElements from './initial-elements'
23+
24+
// some nodes and edges
25+
const elements = ref(initialElements)
26+
</script>
27+
1928
<template>
20-
<VueFlow>
21-
<Background :variant="BackgroundVariant.Dots" pattern-color="#f8f8f8" />
29+
<VueFlow v-model="elements" fit-view-on-init class="vue-flow-basic-example">
30+
<Background />
2231
</VueFlow>
2332
</template>
2433
```

docs/src/guide/components/controls.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,33 @@ npm install @vue-flow/controls
1515

1616
To use the controls simply pass the `Controls` component as a child to the `VueFlow` component.
1717

18+
::: warning
19+
Make sure you also import the styles as these are *not* part of the default theme anymore.
20+
:::
21+
1822
```vue
23+
<script setup>
24+
import { VueFlow } from '@vue-flow/core'
25+
import { Controls } from '@vue-flow/controls'
26+
27+
// import default controls styles
28+
import '@vue-flow/controls/dist/style.css'
29+
30+
import initialElements from './initial-elements'
31+
32+
33+
// some nodes and edges
34+
const elements = ref(initialElements)
35+
</script>
36+
1937
<template>
20-
<VueFlow>
38+
<VueFlow v-model="elements" fit-view-on-init class="vue-flow-basic-example">
2139
<Controls />
2240
</VueFlow>
2341
</template>
2442
```
2543

44+
2645
## [Props](/typedocs/interfaces/ControlProps)
2746

2847
| Name | Definition | Type | Optional | Default |

docs/src/guide/components/minimap.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,26 @@ npm install @vue-flow/minimap
1313

1414
To use the minimap simply pass the `MiniMap` component as a child to the `VueFlow` component.
1515

16+
::: warning
17+
Make sure you also import the styles as these are *not* part of the default theme anymore.
18+
:::
19+
1620
```vue
21+
<script setup>
22+
import { VueFlow } from '@vue-flow/core'
23+
import { MiniMap } from '@vue-flow/minimap'
24+
25+
// import default minimap styles
26+
import '@vue-flow/minimap/dist/style.css'
27+
28+
import initialElements from './initial-elements'
29+
30+
// some nodes and edges
31+
const elements = ref(initialElements)
32+
</script>
33+
1734
<template>
18-
<VueFlow>
35+
<VueFlow v-model="elements" fit-view-on-init class="vue-flow-basic-example">
1936
<MiniMap />
2037
</VueFlow>
2138
</template>

packages/background/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ $ npm i --save @vue-flow/background
1616
## 🎮 Quickstart
1717

1818
```vue
19-
2019
<script setup>
2120
import { VueFlow } from '@vue-flow/core'
2221
import { Background } from '@vue-flow/background'

packages/controls/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ $ npm i --save @vue-flow/controls
1616
## 🎮 Quickstart
1717

1818
```vue
19-
2019
<script setup>
2120
import { VueFlow } from '@vue-flow/core'
2221
import { Controls } from '@vue-flow/controls'

packages/minimap/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ $ npm i --save @vue-flow/minimap
1717
## 🎮 Quickstart
1818

1919
```vue
20-
2120
<script setup>
2221
import { VueFlow } from '@vue-flow/core'
2322
import { MiniMap } from '@vue-flow/minimap'

0 commit comments

Comments
 (0)