update(nodes): watch nodes width for dimension update
* add force param to setElements, if set we clear the elements arr (default true) * wait for store watcher until store is ready (i.e. a state has been set) * move renderer css class to Renderer.vue Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -17,8 +17,10 @@ import {
|
||||
|
||||
const buttonWrapperStyles: CSSProperties = { position: 'absolute', right: 10, top: 10, zIndex: 4 }
|
||||
|
||||
const instance = ref<FlowInstance>()
|
||||
const onLoad = (flowInstance: FlowInstance) => {
|
||||
flowInstance.fitView()
|
||||
instance.value = flowInstance
|
||||
console.log(flowInstance.getElements())
|
||||
}
|
||||
|
||||
@@ -46,6 +48,7 @@ const updatePos = () => {
|
||||
const updateElements = () => {
|
||||
const grid = Math.ceil(Math.random() * 10)
|
||||
elements.value = getElements(grid, grid)
|
||||
setTimeout(() => instance.value.fitView({ padding: 0.5 }))
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user