chore: add changeset
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'@vue-flow/core': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Re-calculate position when node extent changes
|
||||||
@@ -4,7 +4,7 @@ import { Background } from '@vue-flow/background'
|
|||||||
import { Controls } from '@vue-flow/controls'
|
import { Controls } from '@vue-flow/controls'
|
||||||
import { MiniMap } from '@vue-flow/minimap'
|
import { MiniMap } from '@vue-flow/minimap'
|
||||||
|
|
||||||
const { onConnect, addEdges, addNodes } = useVueFlow({
|
const { onConnect, addEdges, addNodes, findNode } = useVueFlow({
|
||||||
fitViewOnInit: true,
|
fitViewOnInit: true,
|
||||||
connectionMode: ConnectionMode.Loose,
|
connectionMode: ConnectionMode.Loose,
|
||||||
nodes: [
|
nodes: [
|
||||||
@@ -14,7 +14,7 @@ const { onConnect, addEdges, addNodes } = useVueFlow({
|
|||||||
label: 'Node 2',
|
label: 'Node 2',
|
||||||
position: { x: 100, y: 100 },
|
position: { x: 100, y: 100 },
|
||||||
class: 'light',
|
class: 'light',
|
||||||
style: { backgroundColor: 'rgba(255, 0, 0, 0.8)', width: '200px', height: '200px' },
|
style: { backgroundColor: 'rgba(255, 0, 0, 0.8)' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: '2a',
|
id: '2a',
|
||||||
@@ -88,6 +88,15 @@ onMounted(() => {
|
|||||||
parentNode: '2',
|
parentNode: '2',
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
const node = findNode('999')!
|
||||||
|
node.expandParent = false
|
||||||
|
node.extent = {
|
||||||
|
range: 'parent',
|
||||||
|
padding: [10],
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user