chore(docs): replace default-zoom with defaut-viewport
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -64,7 +64,7 @@ const toggleClass = () => (dark.value = !dark.value)
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VueFlow v-model="elements" :class="{ dark }" class="basicflow" :default-zoom="1.5" :min-zoom="0.2" :max-zoom="4">
|
<VueFlow v-model="elements" :class="{ dark }" class="basicflow" :default-viewport="{ zoom: 1.5 }" :min-zoom="0.2" :max-zoom="4">
|
||||||
<Background :pattern-color="dark ? '#FFFFFB' : '#aaa'" gap="8" />
|
<Background :pattern-color="dark ? '#FFFFFB' : '#aaa'" gap="8" />
|
||||||
<MiniMap />
|
<MiniMap />
|
||||||
<Controls />
|
<Controls />
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ onMounted(() => {
|
|||||||
:class="[gradient ? 'animated-bg-gradient' : '']"
|
:class="[gradient ? 'animated-bg-gradient' : '']"
|
||||||
:style="{ backgroundColor: bgColor }"
|
:style="{ backgroundColor: bgColor }"
|
||||||
:connection-line-style="connectionLineStyle"
|
:connection-line-style="connectionLineStyle"
|
||||||
:default-zoom="1.5"
|
:default-viewport="{ zoom: 1.5 }"
|
||||||
fit-view-on-init
|
fit-view-on-init
|
||||||
>
|
>
|
||||||
<template #node-custom="{ data }">
|
<template #node-custom="{ data }">
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ onConnect((params) => addEdges([params]))
|
|||||||
v-model="elements"
|
v-model="elements"
|
||||||
class="basicflow"
|
class="basicflow"
|
||||||
:default-edge-options="{ type: 'smoothstep' }"
|
:default-edge-options="{ type: 'smoothstep' }"
|
||||||
:default-zoom="1.5"
|
:default-viewport="{ zoom: 1.5 }"
|
||||||
:min-zoom="0.2"
|
:min-zoom="0.2"
|
||||||
:max-zoom="4"
|
:max-zoom="4"
|
||||||
fit-view-on-init
|
fit-view-on-init
|
||||||
|
|||||||
@@ -22,5 +22,5 @@ onNodeDrag(({ intersections }) => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VueFlow v-model="elements" fit-view-on-init :default-zoom="1.5" :min-zoom="0.2" :max-zoom="4" />
|
<VueFlow v-model="elements" fit-view-on-init :default-viewport="{ zoom: 1.5 }" :min-zoom="0.2" :max-zoom="4" />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { Connection, Edge, Elements } from '@vue-flow/core'
|
import type { Elements } from '@vue-flow/core'
|
||||||
import { VueFlow, addEdge } from '@vue-flow/core'
|
import { VueFlow, useVueFlow } from '@vue-flow/core'
|
||||||
import { Background } from '@vue-flow/additional-components'
|
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import initialElements from './elements'
|
import initialElements from './elements'
|
||||||
import { PathFindingEdge, PerfectArrow } from '~/index'
|
import { PathFindingEdge, PerfectArrow } from '~/index'
|
||||||
|
|
||||||
const elements = ref<Elements>(initialElements)
|
const elements = ref<Elements>(initialElements)
|
||||||
const onConnect = (params: Edge | Connection) => (elements.value = addEdge(params, elements.value))
|
|
||||||
|
const { addEdges, onConnect } = useVueFlow()
|
||||||
|
|
||||||
|
onConnect((params) => addEdges([params]))
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -17,7 +19,6 @@ const onConnect = (params: Edge | Connection) => (elements.value = addEdge(param
|
|||||||
:default-edge-options="{ type: 'perfectArrow' }"
|
:default-edge-options="{ type: 'perfectArrow' }"
|
||||||
:fit-view-on-init="true"
|
:fit-view-on-init="true"
|
||||||
class="vue-flow-basic-example"
|
class="vue-flow-basic-example"
|
||||||
@connect="onConnect"
|
|
||||||
>
|
>
|
||||||
<template #edge-pathFinding="props">
|
<template #edge-pathFinding="props">
|
||||||
<PathFindingEdge v-bind="props" />
|
<PathFindingEdge v-bind="props" />
|
||||||
@@ -25,8 +26,6 @@ const onConnect = (params: Edge | Connection) => (elements.value = addEdge(param
|
|||||||
<template #edge-perfectArrow="props">
|
<template #edge-perfectArrow="props">
|
||||||
<PerfectArrow v-bind="props" />
|
<PerfectArrow v-bind="props" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<Background color="#aaa" :gap="8" />
|
|
||||||
</VueFlow>
|
</VueFlow>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ export default [
|
|||||||
id: 'e2a2b',
|
id: 'e2a2b',
|
||||||
source: '2a',
|
source: '2a',
|
||||||
target: '2b',
|
target: '2b',
|
||||||
type: 'pathFinding',
|
type: 'perfectArrow',
|
||||||
markerEnd,
|
markerEnd,
|
||||||
},
|
},
|
||||||
] as Elements
|
] as Elements
|
||||||
|
|||||||
Reference in New Issue
Block a user