refactor(core): emit pane ready after timeout of 1ms
This commit is contained in:
@@ -209,6 +209,12 @@ export function useActions(
|
|||||||
return res
|
return res
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
if (!state.fitViewOnInitDone && state.fitViewOnInit) {
|
||||||
|
viewportHelper.value.fitView()
|
||||||
|
}
|
||||||
|
|
||||||
|
state.fitViewOnInitDone = true
|
||||||
|
|
||||||
if (changes.length) {
|
if (changes.length) {
|
||||||
state.hooks.nodesChange.trigger(changes)
|
state.hooks.nodesChange.trigger(changes)
|
||||||
}
|
}
|
||||||
@@ -964,19 +970,17 @@ export function useActions(
|
|||||||
until(() => viewportHelper.value.initialized)
|
until(() => viewportHelper.value.initialized)
|
||||||
.toBe(true)
|
.toBe(true)
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
if (state.fitViewOnInit) {
|
setTimeout(() => {
|
||||||
await viewportHelper.value.fitView()
|
state.hooks.paneReady.trigger({
|
||||||
}
|
id,
|
||||||
|
emits,
|
||||||
state.hooks.paneReady.trigger({
|
vueFlowVersion: typeof __VUE_FLOW_VERSION__ !== 'undefined' ? __VUE_FLOW_VERSION__ : 'UNKNOWN',
|
||||||
id,
|
...hooksOn,
|
||||||
emits,
|
...state,
|
||||||
vueFlowVersion: typeof __VUE_FLOW_VERSION__ !== 'undefined' ? __VUE_FLOW_VERSION__ : 'UNKNOWN',
|
...getters,
|
||||||
...hooksOn,
|
...actions,
|
||||||
...state,
|
})
|
||||||
...getters,
|
}, 1)
|
||||||
...actions,
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
return actions
|
return actions
|
||||||
|
|||||||
Reference in New Issue
Block a user