chore: update README

This commit is contained in:
braks
2022-10-10 21:33:44 +02:00
committed by Braks
parent 32aa9e851b
commit 03a982c10f
3 changed files with 62 additions and 17 deletions
+12 -12
View File
@@ -6,10 +6,10 @@ __Custom edge that avoids crossing nodes__
```bash
# install
$ yarn add @vue-flow/core-pathfinding-edge
$ yarn add @vue-flow/pathfinding-edge
# or
$ npm i --save @vue-flow/core-pathfinding-edge
$ npm i --save @vue-flow/pathfinding-edge
```
## 🎮 Quickstart
@@ -17,7 +17,7 @@ $ npm i --save @vue-flow/core-pathfinding-edge
```vue
<script setup>
import { VueFlow, useVueFlow } from '@vue-flow/core'
import { PathFindingEdge } from '@vue-flow/core-pathfinding-edge'
import { PathFindingEdge } from '@vue-flow/pathfinding-edge'
import initialElements from './initial-elements'
const elements = ref(initialElements)
@@ -39,6 +39,15 @@ const { getNodes } = useVueFlow()
```js
// initial-elements.js
export default [
{
id: 'e12',
source: '1',
target: '2',
label: 'Smart Edge',
style: { stroke: 'red' },
// assign pathfinding edge type
type: 'pathfinding'
},
{
id: '1',
label: 'Node 1',
@@ -55,14 +64,5 @@ export default [
y: 90,
},
},
{
id: 'e12',
source: '1',
target: '2',
label: 'Smart Edge',
style: { stroke: 'red' },
// assign pathfinding edge type
type: 'pathfinding'
},
]
```