docs: update component documentation with new examples
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -16,9 +16,18 @@ npm install @vue-flow/background
|
|||||||
To use the background simply pass the `Background` component as a child to the `VueFlow` component.
|
To use the background simply pass the `Background` component as a child to the `VueFlow` component.
|
||||||
|
|
||||||
```vue
|
```vue
|
||||||
|
<script setup>
|
||||||
|
import { VueFlow } from '@vue-flow/core'
|
||||||
|
import { Background } from '@vue-flow/background'
|
||||||
|
import initialElements from './initial-elements'
|
||||||
|
|
||||||
|
// some nodes and edges
|
||||||
|
const elements = ref(initialElements)
|
||||||
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VueFlow>
|
<VueFlow v-model="elements" fit-view-on-init class="vue-flow-basic-example">
|
||||||
<Background :variant="BackgroundVariant.Dots" pattern-color="#f8f8f8" />
|
<Background />
|
||||||
</VueFlow>
|
</VueFlow>
|
||||||
</template>
|
</template>
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -15,14 +15,33 @@ npm install @vue-flow/controls
|
|||||||
|
|
||||||
To use the controls simply pass the `Controls` component as a child to the `VueFlow` component.
|
To use the controls simply pass the `Controls` component as a child to the `VueFlow` component.
|
||||||
|
|
||||||
|
::: warning
|
||||||
|
Make sure you also import the styles as these are *not* part of the default theme anymore.
|
||||||
|
:::
|
||||||
|
|
||||||
```vue
|
```vue
|
||||||
|
<script setup>
|
||||||
|
import { VueFlow } from '@vue-flow/core'
|
||||||
|
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)
|
||||||
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VueFlow>
|
<VueFlow v-model="elements" fit-view-on-init class="vue-flow-basic-example">
|
||||||
<Controls />
|
<Controls />
|
||||||
</VueFlow>
|
</VueFlow>
|
||||||
</template>
|
</template>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## [Props](/typedocs/interfaces/ControlProps)
|
## [Props](/typedocs/interfaces/ControlProps)
|
||||||
|
|
||||||
| Name | Definition | Type | Optional | Default |
|
| Name | Definition | Type | Optional | Default |
|
||||||
|
|||||||
@@ -13,9 +13,26 @@ npm install @vue-flow/minimap
|
|||||||
|
|
||||||
To use the minimap simply pass the `MiniMap` component as a child to the `VueFlow` component.
|
To use the minimap simply pass the `MiniMap` component as a child to the `VueFlow` component.
|
||||||
|
|
||||||
|
::: warning
|
||||||
|
Make sure you also import the styles as these are *not* part of the default theme anymore.
|
||||||
|
:::
|
||||||
|
|
||||||
```vue
|
```vue
|
||||||
|
<script setup>
|
||||||
|
import { VueFlow } from '@vue-flow/core'
|
||||||
|
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)
|
||||||
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VueFlow>
|
<VueFlow v-model="elements" fit-view-on-init class="vue-flow-basic-example">
|
||||||
<MiniMap />
|
<MiniMap />
|
||||||
</VueFlow>
|
</VueFlow>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ $ npm i --save @vue-flow/background
|
|||||||
## 🎮 Quickstart
|
## 🎮 Quickstart
|
||||||
|
|
||||||
```vue
|
```vue
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { VueFlow } from '@vue-flow/core'
|
import { VueFlow } from '@vue-flow/core'
|
||||||
import { Background } from '@vue-flow/background'
|
import { Background } from '@vue-flow/background'
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ $ npm i --save @vue-flow/controls
|
|||||||
## 🎮 Quickstart
|
## 🎮 Quickstart
|
||||||
|
|
||||||
```vue
|
```vue
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { VueFlow } from '@vue-flow/core'
|
import { VueFlow } from '@vue-flow/core'
|
||||||
import { Controls } from '@vue-flow/controls'
|
import { Controls } from '@vue-flow/controls'
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ $ npm i --save @vue-flow/minimap
|
|||||||
## 🎮 Quickstart
|
## 🎮 Quickstart
|
||||||
|
|
||||||
```vue
|
```vue
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { VueFlow } from '@vue-flow/core'
|
import { VueFlow } from '@vue-flow/core'
|
||||||
import { MiniMap } from '@vue-flow/minimap'
|
import { MiniMap } from '@vue-flow/minimap'
|
||||||
|
|||||||
Reference in New Issue
Block a user