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:
@@ -11,11 +11,7 @@ const props = defineProps<RendererProps>()
|
||||
const store = useStore()
|
||||
|
||||
// if there are preloaded elements we overwrite the current elements with the stored ones and reset the stored elements (so we can properly parse them)
|
||||
const hasInitialElements = store.elements.length
|
||||
const initialElements = hasInitialElements ? store.elements : props.elements
|
||||
if (hasInitialElements) store.elements = []
|
||||
|
||||
await store.setElements(initialElements)
|
||||
await store.setElements(props.elements, false)
|
||||
store.isReady = true
|
||||
|
||||
nextTick(async () => {
|
||||
@@ -45,5 +41,7 @@ export default {
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<slot />
|
||||
<div class="vue-flow__renderer">
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user