chore(docs): update example styles (#1469)
* chore(docs): update basic example styles * chore(docs): update confirm delete example styles * chore(docs): update dnd example styles * chore(docs): update hidden example * chore(docs): update update node example * chore(docs): update node toolbar example styles * chore(docs): update transition example styles * chore(docs): cleanup basic example els * chore(docs): cleanup examples
This commit is contained in:
@@ -1,23 +1,29 @@
|
||||
<script setup>
|
||||
import { Handle, Position } from '@vue-flow/core'
|
||||
import { Handle, Position, useVueFlow } from '@vue-flow/core'
|
||||
import { NodeToolbar } from '@vue-flow/node-toolbar'
|
||||
|
||||
defineProps(['data', 'label'])
|
||||
const props = defineProps(['id', 'data'])
|
||||
|
||||
const actions = ['👎', '✋', '👍']
|
||||
|
||||
const { updateNodeData } = useVueFlow()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NodeToolbar
|
||||
style="display: flex; gap: 0.5rem; align-items: center"
|
||||
:is-visible="data.toolbarVisible"
|
||||
:position="data.toolbarPosition"
|
||||
>
|
||||
<button>Action1</button>
|
||||
<button>Action2</button>
|
||||
<button>Action3</button>
|
||||
<NodeToolbar :is-visible="data.toolbarVisible" :position="data.toolbarPosition">
|
||||
<button
|
||||
v-for="action of actions"
|
||||
:key="action"
|
||||
type="button"
|
||||
:class="{ selected: action === data.action }"
|
||||
@click="updateNodeData(props.id, { action })"
|
||||
>
|
||||
{{ action }}
|
||||
</button>
|
||||
</NodeToolbar>
|
||||
|
||||
<div :style="{ padding: '10px 20px' }">
|
||||
{{ label }}
|
||||
<div>
|
||||
{{ data.label }}
|
||||
</div>
|
||||
|
||||
<Handle type="target" :position="Position.Left" />
|
||||
|
||||
Reference in New Issue
Block a user