diff --git a/.changeset/mean-horses-swim.md b/.changeset/mean-horses-swim.md new file mode 100644 index 00000000..5b6544eb --- /dev/null +++ b/.changeset/mean-horses-swim.md @@ -0,0 +1,5 @@ +--- +"@vue-flow/core": patch +--- + +Correct access of options id in `useVueFlow` diff --git a/packages/core/src/composables/useVueFlow.ts b/packages/core/src/composables/useVueFlow.ts index 9de7839d..c4f7427a 100644 --- a/packages/core/src/composables/useVueFlow.ts +++ b/packages/core/src/composables/useVueFlow.ts @@ -30,9 +30,9 @@ export function useVueFlow(idOrOpts?: any): VueFlowStore { const isOptsObj = typeof idOrOpts === 'object' - const options = isOptsObj ? idOrOpts : undefined + const options = isOptsObj ? idOrOpts : { id: idOrOpts } - const id = options?.id ?? idOrOpts + const id = options.id const vueFlowId = scope?.vueFlowId || id let vueFlow: Injection