Skip to content

Commit

Permalink
fix(core): correct id access in useVueFlow (#1483)
Browse files Browse the repository at this point in the history
* fix(core): correct id access in `useVueFlow`

* chore(changeset): add
  • Loading branch information
bcakmakoglu committed Jun 18, 2024
1 parent aab43d5 commit e2ce205
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/mean-horses-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@vue-flow/core": patch
---

Correct access of options id in `useVueFlow`
4 changes: 2 additions & 2 deletions packages/core/src/composables/useVueFlow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e2ce205

Please sign in to comment.