update(examples): use computedPosition in GroupNode.vue
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -8,26 +8,28 @@ store.hooks.nodeDragStop.on(({ node }) => {
|
||||
const nodes = getNodesInside(
|
||||
store.getNodes,
|
||||
{
|
||||
height: props.height,
|
||||
width: props.width,
|
||||
x: props.position.x,
|
||||
y: props.position.y,
|
||||
...props.dimensions,
|
||||
x: props.computedPosition.x,
|
||||
y: props.computedPosition.y,
|
||||
},
|
||||
store.transform,
|
||||
)
|
||||
if (nodes.some((n) => n.id === node.id)) {
|
||||
node.data.label = `In ${props.id}`
|
||||
node.data.group = props.id
|
||||
} else if (node.data.group === props.id) {
|
||||
console.log(nodes)
|
||||
if (nodes.some((n) => n.id === node.id && n.id !== props.id)) {
|
||||
node.label = `In ${props.id}`
|
||||
node.data = {
|
||||
group: props.id,
|
||||
}
|
||||
} else if (node.data?.group === props.id) {
|
||||
node.data.group = undefined
|
||||
node.data.label = node.id
|
||||
node.label = node.id
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<template>
|
||||
<div class="vue-flow__group-node">
|
||||
<Handle type="target" :position="Position.Top" />
|
||||
<strong>Group {{ data.label }}</strong>
|
||||
<strong>Group {{ label }}</strong>
|
||||
<Handle type="source" :position="Position.Bottom" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user