fix(flow): check for scope before providing store
This commit is contained in:
@@ -40,8 +40,9 @@ export default defineComponent({
|
|||||||
onNodeDragStop(e: FlowEvents['nodeDragStop']) {
|
onNodeDragStop(e: FlowEvents['nodeDragStop']) {
|
||||||
console.log('drag stop', e)
|
console.log('drag stop', e)
|
||||||
},
|
},
|
||||||
onPaneReady({ fitView }: FlowEvents['paneReady']) {
|
onPaneReady(instance: FlowEvents['paneReady']) {
|
||||||
fitView({ padding: 0.1 })
|
instance.fitView()
|
||||||
|
this.instance = instance
|
||||||
},
|
},
|
||||||
onConnect(params: FlowEvents['connect']) {
|
onConnect(params: FlowEvents['connect']) {
|
||||||
addEdge(params, this.elements)
|
addEdge(params, this.elements)
|
||||||
|
|||||||
@@ -109,7 +109,8 @@ export default <NodeData = ElementData, EdgeData = ElementData>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!vueFlow) throw new Error('vue flow store instance not found.')
|
if (!vueFlow) throw new Error('vue flow store instance not found.')
|
||||||
provide(VueFlow, vueFlow)
|
|
||||||
|
if (scope) provide(VueFlow, vueFlow)
|
||||||
|
|
||||||
return vueFlow
|
return vueFlow
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user