Skip to content

Commit

Permalink
docs:add update elements demos
Browse files Browse the repository at this point in the history
  • Loading branch information
pomelo-nwu committed Feb 8, 2021
1 parent 8477320 commit b395665
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/graphin/docs/render/update/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ nav:

## 节点更新

> 可以右键菜单,更新以下节点,核心是调用 `graph.updateItem()` 方法
<code src='./node.tsx'>
25 changes: 25 additions & 0 deletions packages/graphin/docs/render/update/node.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,31 @@ const UpdateNode = () => {
},
});
}
if (item.id === 'node-3') {
graph.updateItem(item.id, {
style: {
// @ts-ignore
label: {
value: 'update halo hidden',
},
halo: {
visible: false,
},
status: {
hover: {
halo: {
visible: false,
},
},
selected: {
halo: {
visible: false,
},
},
},
},
});
}
};
return (
<ContextMenu bindType="node">
Expand Down

0 comments on commit b395665

Please sign in to comment.