Skip to content

Commit

Permalink
feat: 兼容 getNodes
Browse files Browse the repository at this point in the history
  • Loading branch information
lhbxs committed Jan 16, 2025
1 parent e01c1ac commit 8b0cb62
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/x-flow/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@xrenders/xflow",
"version": "1.0.3",
"version": "1.0.4-beta.1",
"description": "一款功能强大、易用灵活的流程编辑器框架,帮助你轻松构建复杂的工作流和流程产品",
"keywords": [
"xflow"
Expand Down
11 changes: 10 additions & 1 deletion packages/x-flow/src/models/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,16 @@ const createStore = (initProps?: Partial<FlowProps>) => {
set({ nodes: isTransform ? transformNodes(nodes) : nodes });
},
getNodes: () => {
return get().nodes;
const nodes = get().nodes;
const result = nodes.map(item => {
const { data, ...rest } = item;
const { _nodeType, ...restData } = data;
return {
...rest,
data: restData
}
});
return result;
},
setEdges: edges => {
set({ edges });
Expand Down

0 comments on commit 8b0cb62

Please sign in to comment.