File tree 2 files changed +14
-6
lines changed
packages/core/src/composables
2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @vue-flow/core " : minor
3
+ ---
4
+
5
+ Allow passing null or undefined to ` useNodeConnections ` options
Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ import { useNodeId } from './useNodeId'
6
6
import { useVueFlow } from './useVueFlow'
7
7
8
8
export interface UseNodeConnectionsParams {
9
- handleType ?: MaybeRefOrGetter < HandleType >
10
- handleId ?: MaybeRefOrGetter < string | null >
11
- nodeId ?: MaybeRefOrGetter < string | null >
9
+ handleType ?: MaybeRefOrGetter < HandleType | null | undefined >
10
+ handleId ?: MaybeRefOrGetter < string | null | undefined >
11
+ nodeId ?: MaybeRefOrGetter < string | null | undefined >
12
12
onConnect ?: ( connections : NodeConnection [ ] ) => void
13
13
onDisconnect ?: ( connections : NodeConnection [ ] ) => void
14
14
}
@@ -42,9 +42,12 @@ export function useNodeConnections(params: UseNodeConnectionsParams = {}) {
42
42
const currentHandleType = toValue ( handleType )
43
43
const currHandleId = toValue ( handleId )
44
44
45
- return `${ currNodeId } ${
46
- currentHandleType ? ( currHandleId ? `-${ currentHandleType } -${ currHandleId } ` : `-${ currentHandleType } ` ) : ''
47
- } `
45
+ let handleSuffix = ''
46
+ if ( currentHandleType ) {
47
+ handleSuffix = currHandleId ? `-${ currentHandleType } -${ currHandleId } ` : `-${ currentHandleType } `
48
+ }
49
+
50
+ return `${ currNodeId } ${ handleSuffix } `
48
51
} )
49
52
50
53
watch (
You can’t perform that action at this time.
0 commit comments