chore(docs): update custom node example

This commit is contained in:
braks
2024-02-05 07:51:12 +01:00
committed by Braks
parent 10060064f2
commit 2637733aa9
4 changed files with 44 additions and 93 deletions
+10 -6
View File
@@ -1,17 +1,21 @@
<script setup>
import { useHandleConnections, useNodesData } from '@vue-flow/core'
import { Handle, Position, useHandleConnections, useNodesData } from '@vue-flow/core'
const props = defineProps({
id: {
type: String,
defineProps({
data: {
type: Object,
required: true,
},
})
const connections = useHandleConnections({
nodeId: props.id,
type: 'target',
})
const data = useNodesData()
const data = useNodesData(() => connections.value[0]?.source)
</script>
<template>
<Handle type="target" :position="Position.Left" :style="{ backgroundColor: data?.color, filter: 'invert(100%)' }" />
{{ data?.isGradient ? 'GRADIENT' : data?.color }}
</template>