chore(docs): replace the deprecated enum PanelPosition (#979)

This commit is contained in:
Alex Liu
2023-07-10 18:22:50 +02:00
committed by GitHub
parent 70528f8a99
commit 5669c8b101
11 changed files with 22 additions and 22 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
<script setup> <script setup>
import { Panel, PanelPosition, VueFlow, isNode, useVueFlow } from '@vue-flow/core' import { Panel, VueFlow, isNode, useVueFlow } from '@vue-flow/core'
import { Background } from '@vue-flow/background' import { Background } from '@vue-flow/background'
import { Controls } from '@vue-flow/controls' import { Controls } from '@vue-flow/controls'
import { MiniMap } from '@vue-flow/minimap' import { MiniMap } from '@vue-flow/minimap'
@@ -78,7 +78,7 @@ function toggleClass() {
<Controls /> <Controls />
<Panel :position="PanelPosition.TopRight" class="controls"> <Panel position="top-right" class="controls">
<button style="background-color: #113285; color: white" title="Reset Transform" @click="resetTransform"> <button style="background-color: #113285; color: white" title="Reset Transform" @click="resetTransform">
<svg width="16" height="16" viewBox="0 0 32 32"> <svg width="16" height="16" viewBox="0 0 32 32">
<path fill="#FFFFFB" d="M18 28A12 12 0 1 0 6 16v6.2l-3.6-3.6L1 20l6 6l6-6l-1.4-1.4L8 22.2V16a10 10 0 1 1 10 10Z" /> <path fill="#FFFFFB" d="M18 28A12 12 0 1 0 6 16v6.2l-3.6-3.6L1 20l6 6l6-6l-1.4-1.4L8 22.2V16a10 10 0 1 1 10 10Z" />
+2 -2
View File
@@ -1,5 +1,5 @@
<script setup> <script setup>
import { Panel, PanelPosition, VueFlow, useVueFlow } from '@vue-flow/core' import { Panel, VueFlow, useVueFlow } from '@vue-flow/core'
import { Background, BackgroundVariant } from '@vue-flow/background' import { Background, BackgroundVariant } from '@vue-flow/background'
import { MiniMap } from '@vue-flow/minimap' import { MiniMap } from '@vue-flow/minimap'
@@ -26,7 +26,7 @@ function addRandomNode() {
<Background :variant="BackgroundVariant.Lines" /> <Background :variant="BackgroundVariant.Lines" />
<Panel :position="PanelPosition.TopRight"> <Panel position="top-right">
<button type="button" @click="addRandomNode">add node</button> <button type="button" @click="addRandomNode">add node</button>
</Panel> </Panel>
</VueFlow> </VueFlow>
+2 -2
View File
@@ -1,6 +1,6 @@
<script setup> <script setup>
import { Background } from '@vue-flow/background' import { Background } from '@vue-flow/background'
import { Panel, PanelPosition, VueFlow, useVueFlow } from '@vue-flow/core' import { Panel, VueFlow, useVueFlow } from '@vue-flow/core'
import { ref, watch } from 'vue' import { ref, watch } from 'vue'
const isHidden = ref(false) const isHidden = ref(false)
@@ -29,7 +29,7 @@ watch(isHidden, () => {
<VueFlow fit-view-on-init> <VueFlow fit-view-on-init>
<Background /> <Background />
<Panel :position="PanelPosition.TopRight"> <Panel position="top-right">
<div> <div>
<label for="ishidden"> <label for="ishidden">
hidden hidden
+2 -2
View File
@@ -1,6 +1,6 @@
<script setup> <script setup>
import { Background } from '@vue-flow/background' import { Background } from '@vue-flow/background'
import { Panel, PanelPosition, VueFlow, isNode } from '@vue-flow/core' import { Panel, VueFlow, isNode } from '@vue-flow/core'
import { ref } from 'vue' import { ref } from 'vue'
const elements = ref([ const elements = ref([
@@ -32,7 +32,7 @@ function updatePos() {
<VueFlow v-model="elements" fit-view-on-init> <VueFlow v-model="elements" fit-view-on-init>
<Background /> <Background />
<Panel :position="PanelPosition.TopRight"> <Panel position="top-right">
<button style="margin-right: 5px" @click="updatePos">update positions</button> <button style="margin-right: 5px" @click="updatePos">update positions</button>
<button @click="toggleClass">toggle class</button> <button @click="toggleClass">toggle class</button>
</Panel> </Panel>
@@ -1,5 +1,5 @@
<script setup> <script setup>
import { Panel, PanelPosition, useVueFlow } from '@vue-flow/core' import { Panel, useVueFlow } from '@vue-flow/core'
const flowKey = 'example-flow' const flowKey = 'example-flow'
@@ -34,7 +34,7 @@ function onAdd() {
</script> </script>
<template> <template>
<Panel :position="PanelPosition.TopRight" class="save-restore-controls"> <Panel position="top-right" class="save-restore-controls">
<button style="background-color: #33a6b8" @click="onSave">save</button> <button style="background-color: #33a6b8" @click="onSave">save</button>
<button style="background-color: #113285" @click="onRestore">restore</button> <button style="background-color: #113285" @click="onRestore">restore</button>
<button style="background-color: #6f3381" @click="onAdd">add node</button> <button style="background-color: #6f3381" @click="onAdd">add node</button>
+2 -2
View File
@@ -1,5 +1,5 @@
<script setup> <script setup>
import { Panel, PanelPosition, VueFlow, isNode, useVueFlow } from '@vue-flow/core' import { Panel, VueFlow, isNode, useVueFlow } from '@vue-flow/core'
import { Background } from '@vue-flow/background' import { Background } from '@vue-flow/background'
import { MiniMap } from '@vue-flow/minimap' import { MiniMap } from '@vue-flow/minimap'
import { nextTick, ref } from 'vue' import { nextTick, ref } from 'vue'
@@ -43,7 +43,7 @@ function updatePos() {
<Background /> <Background />
<Panel :position="PanelPosition.TopRight"> <Panel position="top-right">
<button style="margin-right: 5px" @click="updatePos">update positions</button> <button style="margin-right: 5px" @click="updatePos">update positions</button>
<button @click="toggleClass">toggle class</button> <button @click="toggleClass">toggle class</button>
</Panel> </Panel>
+2 -2
View File
@@ -1,6 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { Elements } from '@vue-flow/core' import type { Elements } from '@vue-flow/core'
import { Panel, PanelPosition, VueFlow, isNode, useVueFlow } from '@vue-flow/core' import { Panel, VueFlow, isNode, useVueFlow } from '@vue-flow/core'
import { Background } from '@vue-flow/background' import { Background } from '@vue-flow/background'
import { Controls } from '@vue-flow/controls' import { Controls } from '@vue-flow/controls'
@@ -49,7 +49,7 @@ function toggleclass() {
<Background /> <Background />
<MiniMap /> <MiniMap />
<Controls /> <Controls />
<Panel :position="PanelPosition.TopRight" style="display: flex; gap: 5px"> <Panel position="top-right" style="display: flex; gap: 5px">
<button @click="resetTransform">reset transform</button> <button @click="resetTransform">reset transform</button>
<button @click="updatePos">change pos</button> <button @click="updatePos">change pos</button>
<button @click="toggleclass">toggle class</button> <button @click="toggleclass">toggle class</button>
@@ -1,5 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import { Panel, PanelPosition, VueFlow, useVueFlow } from '@vue-flow/core' import { Panel, VueFlow, useVueFlow } from '@vue-flow/core'
import { Controls } from '@vue-flow/controls' import { Controls } from '@vue-flow/controls'
import { MiniMap } from '@vue-flow/minimap' import { MiniMap } from '@vue-flow/minimap'
@@ -57,7 +57,7 @@ onMoveEnd((flowTransform) => console.log('move end', flowTransform))
<Controls /> <Controls />
<Panel :position="PanelPosition.TopLeft"> <Panel position="top-left">
<div> <div>
<label for="draggable"> <label for="draggable">
nodesDraggable nodesDraggable
@@ -1,7 +1,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import dagre from 'dagre' import dagre from 'dagre'
import type { CoordinateExtent, Elements } from '@vue-flow/core' import type { CoordinateExtent, Elements } from '@vue-flow/core'
import { ConnectionMode, Panel, PanelPosition, Position, VueFlow, isNode } from '@vue-flow/core' import { ConnectionMode, Panel, Position, VueFlow, isNode } from '@vue-flow/core'
import { Controls } from '@vue-flow/controls' import { Controls } from '@vue-flow/controls'
import '@vue-flow/controls/dist/style.css' import '@vue-flow/controls/dist/style.css'
@@ -49,7 +49,7 @@ function onLayout(direction: string) {
<VueFlow v-model="elements" :node-extent="nodeExtent" :connection-mode="ConnectionMode.Loose" @pane-ready="onLayout('TB')"> <VueFlow v-model="elements" :node-extent="nodeExtent" :connection-mode="ConnectionMode.Loose" @pane-ready="onLayout('TB')">
<Controls /> <Controls />
<Panel style="display: flex; gap: 10px" :position="PanelPosition.TopRight"> <Panel style="display: flex; gap: 10px" position="top-right">
<button :style="{ marginRight: 10 }" @click="onLayout('TB')">vertical layout</button> <button :style="{ marginRight: 10 }" @click="onLayout('TB')">vertical layout</button>
<button @click="onLayout('LR')">horizontal layout</button> <button @click="onLayout('LR')">horizontal layout</button>
</Panel> </Panel>
+2 -2
View File
@@ -1,5 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import { Panel, PanelPosition, VueFlow, useVueFlow } from '@vue-flow/core' import { Panel, VueFlow, useVueFlow } from '@vue-flow/core'
import useStore from './store' import useStore from './store'
const store = useStore() const store = useStore()
@@ -11,7 +11,7 @@ onConnect(addEdges)
<template> <template>
<VueFlow v-model="store.elements" fit-view-on-init> <VueFlow v-model="store.elements" fit-view-on-init>
<Panel :position="PanelPosition.TopCenter"> <Panel position="top-center">
<button @click="store.updatePosition">update positions</button> <button @click="store.updatePosition">update positions</button>
<button @click="store.toggleClass">toggle class</button> <button @click="store.toggleClass">toggle class</button>
<button @click="store.log">log store state</button> <button @click="store.log">log store state</button>
+2 -2
View File
@@ -1,5 +1,5 @@
<script setup> <script setup>
import { Panel, PanelPosition, VueFlow, isNode, useVueFlow } from '@vue-flow/core' import { Panel, VueFlow, isNode, useVueFlow } from '@vue-flow/core'
import { nextTick, ref } from 'vue' import { nextTick, ref } from 'vue'
import { Background } from '@vue-flow/background' import { Background } from '@vue-flow/background'
import { getElements } from './utils' import { getElements } from './utils'
@@ -42,7 +42,7 @@ function updatePos() {
<VueFlow v-model="elements" :min-zoom="0.1"> <VueFlow v-model="elements" :min-zoom="0.1">
<Background /> <Background />
<Panel :position="PanelPosition.TopRight"> <Panel position="top-right">
<button style="margin-right: 5px" @click="updatePos">update positions</button> <button style="margin-right: 5px" @click="updatePos">update positions</button>
<button @click="toggleClass">toggle class</button> <button @click="toggleClass">toggle class</button>
</Panel> </Panel>