feat(flow): Add state as refs, getters and actions to vueFlow object for easier access
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -11,11 +11,13 @@ export default (options?: FlowOptions): UseVueFlow => {
|
||||
: false
|
||||
if (!vueFlow || (vueFlow && options?.id && options.id !== vueFlow.id)) {
|
||||
const name = options?.id ?? `vue-flow-${id++}`
|
||||
const store = reactive(useStore(name, options))
|
||||
const store = useStore(name, options)
|
||||
vueFlow = {
|
||||
id: name,
|
||||
store,
|
||||
...toRefs(store),
|
||||
store: reactive(store),
|
||||
...toRefs(store.state),
|
||||
...store.getters,
|
||||
...store.actions,
|
||||
...store.hooksOn,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user