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:
@@ -98,12 +98,17 @@ const updateNodeDimensions = ({ nodeElement, forceUpdate }: NodeDimensionUpdate)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
updateNodeDimensions({
|
||||
id: props.node.id,
|
||||
nodeElement: nodeElement.value,
|
||||
forceUpdate: true,
|
||||
})
|
||||
|
||||
watch(
|
||||
() => props.node.__vf.width,
|
||||
() => {
|
||||
updateNodeDimensions({
|
||||
id: props.node.id,
|
||||
nodeElement: nodeElement.value,
|
||||
forceUpdate: true,
|
||||
})
|
||||
},
|
||||
{ immediate: true },
|
||||
)
|
||||
useResizeObserver(nodeElement, (entries) =>
|
||||
entries.forEach((entry) => {
|
||||
updateNodeDimensions({
|
||||
|
||||
Reference in New Issue
Block a user