chore: couple minor fixes
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -14,7 +14,7 @@ const props = withDefaults(defineProps<MiniMapProps>(), {
|
||||
maskColor: 'rgb(240, 242, 243, 0.7)',
|
||||
})
|
||||
|
||||
const attrs = useAttrs()
|
||||
const attrs: Record<string, any> = useAttrs()
|
||||
const window = useWindow()
|
||||
|
||||
const defaultWidth = 200
|
||||
|
||||
@@ -11,7 +11,7 @@ export default <N = any, E = N>(options?: Partial<FlowOptions<N, E>>): UseVueFlo
|
||||
let vueFlow: UseVueFlow | null = scope ? inject(VueFlow, null) ?? (scope.vueFlow as UseVueFlow) : null
|
||||
if (!vueFlow || (vueFlow && options?.id && options.id !== vueFlow.id)) {
|
||||
const name = options?.id ?? `vue-flow-${id++}`
|
||||
let store: Store = useStore(options)
|
||||
const store: Store = useStore(options)
|
||||
vueFlow = {
|
||||
id: name,
|
||||
store: reactive(store),
|
||||
@@ -25,12 +25,6 @@ export default <N = any, E = N>(options?: Partial<FlowOptions<N, E>>): UseVueFlo
|
||||
provide(VueFlow, vueFlow)
|
||||
scope.vueFlow = vueFlow
|
||||
}
|
||||
|
||||
onScopeDispose(() => {
|
||||
vueFlow = null as UseVueFlow
|
||||
scope.vueFlow = null as UseVueFlow
|
||||
store = null as Store
|
||||
})
|
||||
}
|
||||
if (!vueFlow) throw new Error('VueFlow instance not found.')
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ export default (
|
||||
if (v && Array.isArray(v)) {
|
||||
pause()
|
||||
store.setNodes(v)
|
||||
if (nodes) nodes = store.nodes
|
||||
if (nodes) nodes.value = store.nodes
|
||||
await nextTick()
|
||||
resume()
|
||||
}
|
||||
@@ -44,7 +44,7 @@ export default (
|
||||
if (v && Array.isArray(v)) {
|
||||
pause()
|
||||
store.setEdges(v)
|
||||
if (edges) edges = store.edges
|
||||
if (edges) edges.value = store.edges
|
||||
await nextTick()
|
||||
resume()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user