feat(examples): add node-toolbar example
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<script lang="ts" setup>
|
||||
import { Handle, Position } from '@vue-flow/core'
|
||||
import { NodeToolbar } from '@vue-flow/node-toolbar'
|
||||
|
||||
interface NodeData {
|
||||
toolbarVisible: boolean
|
||||
toolbarPosition: Position
|
||||
}
|
||||
|
||||
interface Props {
|
||||
data: NodeData
|
||||
label: string
|
||||
}
|
||||
|
||||
defineProps<Props>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NodeToolbar :is-visible="data.toolbarVisible" :position="data.toolbarPosition">
|
||||
<button>delete</button>
|
||||
<button>copy</button>
|
||||
<button>expand</button>
|
||||
</NodeToolbar>
|
||||
|
||||
<div :style="{ padding: '10px 20px' }">
|
||||
{{ label }}
|
||||
</div>
|
||||
|
||||
<Handle type="target" :position="Position.Left" />
|
||||
<Handle type="source" :position="Position.Right" />
|
||||
</template>
|
||||
Reference in New Issue
Block a user