docs: update examples

This commit is contained in:
braks
2022-11-13 19:13:43 +01:00
committed by Braks
parent f6a97c504b
commit cd03034bdb
35 changed files with 222 additions and 161 deletions
+10 -3
View File
@@ -1,4 +1,5 @@
<script setup>
import { Background, MiniMap, Panel, PanelPosition } from '@vue-flow/additional-components'
import { VueFlow, isNode, useVueFlow } from '@vue-flow/core'
import { nextTick, ref } from 'vue'
import { getElements } from './utils.js'
@@ -12,6 +13,7 @@ onPaneReady((i) => {
i.fitView({
padding: 0.2,
})
console.log(i.getElements.value)
})
@@ -26,6 +28,7 @@ const updatePos = () => {
}
}
})
nextTick(() => {
fitView({ duration: 1000, padding: 0.5 })
})
@@ -34,9 +37,13 @@ const updatePos = () => {
<template>
<VueFlow v-model="elements" :min-zoom="0.1">
<div style="position: absolute; right: 10px; top: 10px; z-index: 4">
<MiniMap />
<Background />
<Panel :position="PanelPosition.TopRight">
<button style="margin-right: 5px" @click="updatePos">update positions</button>
<button style="margin-right: 5px" @click="toggleClass">toggle class</button>
</div>
<button @click="toggleClass">toggle class</button>
</Panel>
</VueFlow>
</template>