chore: add changeset

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2023-01-04 13:48:40 +01:00
committed by Braks
parent 94344a6d42
commit ea5c35e5fa
2 changed files with 16 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
---
'@vue-flow/core': patch
---
Re-calculate position when node extent changes

View File

@@ -4,7 +4,7 @@ import { Background } from '@vue-flow/background'
import { Controls } from '@vue-flow/controls'
import { MiniMap } from '@vue-flow/minimap'
const { onConnect, addEdges, addNodes } = useVueFlow({
const { onConnect, addEdges, addNodes, findNode } = useVueFlow({
fitViewOnInit: true,
connectionMode: ConnectionMode.Loose,
nodes: [
@@ -14,7 +14,7 @@ const { onConnect, addEdges, addNodes } = useVueFlow({
label: 'Node 2',
position: { x: 100, y: 100 },
class: 'light',
style: { backgroundColor: 'rgba(255, 0, 0, 0.8)', width: '200px', height: '200px' },
style: { backgroundColor: 'rgba(255, 0, 0, 0.8)' },
},
{
id: '2a',
@@ -88,6 +88,15 @@ onMounted(() => {
parentNode: '2',
},
])
setTimeout(() => {
const node = findNode('999')!
node.expandParent = false
node.extent = {
range: 'parent',
padding: [10],
}
})
})
</script>