Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

👑 [需求]自定义连线 #103

Open
GitHdu opened this issue Jun 17, 2024 · 0 comments
Open

👑 [需求]自定义连线 #103

GitHdu opened this issue Jun 17, 2024 · 0 comments

Comments

@GitHdu
Copy link

GitHdu commented Jun 17, 2024

🥰 需求描述

flowEditor
自定义连线需要修改 onConnect 的参数,现在的封装```
updateEdgesOnConnection: (connection) => {
const { source, target, sourceHandle, targetHandle } = connection;

if (!source || !target) return;

const edgeId = generateEdgeId(source, target, sourceHandle, targetHandle);

const edge: Edge = {
  id: edgeId,
  source: source,
  target: target,
  sourceHandle,
  targetHandle,
};
// 这里无法扩展 edge 的 type
get().dispatchEdges({ type: 'addEdge', edge });

return edge;

},```

🧐 解决方案

现在只能在 onConnect 里增加 type,手动 addEdge,然后在 afterConnect 里移除你们增加的
addEdge 的传参是不是可以交还给开发者

🚑 其他信息

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant