docs: update examples
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user