diff --git a/docs/src/examples/edges/validation.md b/docs/src/examples/edges/validation.md index 615fcdd7..1ec44f05 100644 --- a/docs/src/examples/edges/validation.md +++ b/docs/src/examples/edges/validation.md @@ -1,32 +1,20 @@ # Connection Validation -Connections can be validated before edges are created and nodes get connected. +To validate connections before they are created you can either pass a function to the `is-valid-connection` prop of the `` component +or use the `onConnect` event of the `` component. + +Another alternative is to pass a `isValidConnection` function to the `is-valid-connection` prop of the `` component. +This function will be applied to *all* connections in the flow (even existing ones). ## Using a handle in a custom node ```vue
- [ ... ] - - + +
``` -## Passing as node option - -```ts -const nodes = [ - { - id: '1', - label: 'Node 1', - position: { x: 0, y: 0 }, - isValidSourcePos: (connection) => { - return connection.target === '2' - }, - }, -] -``` -