Skip to content

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

Open
@GitHdu

Description

🥰 需求描述

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 的传参是不是可以交还给开发者

🚑 其他信息

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions