fix(edges): pass auto-connector result as new edge params
This commit is contained in:
@@ -175,13 +175,14 @@ export default (models: ToRefs<Pick<FlowProps, 'nodes' | 'edges' | 'modelValue'>
|
|||||||
const watchAutoConnect = () => {
|
const watchAutoConnect = () => {
|
||||||
scope.run(() => {
|
scope.run(() => {
|
||||||
const autoConnector = async (params: Connection) => {
|
const autoConnector = async (params: Connection) => {
|
||||||
let connect: boolean | Connection = true
|
let connection: boolean | Connection = params
|
||||||
|
|
||||||
if (isFunction(props.autoConnect)) {
|
if (isFunction(props.autoConnect)) {
|
||||||
connect = await props.autoConnect(params)
|
connection = await props.autoConnect(params)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (connect) {
|
if (connection !== false) {
|
||||||
store.addEdges([params])
|
store.addEdges([connection])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user