NodePanel add AutoComplete

This commit is contained in:
zhandouxiaojiji committed 2020-11-02 16:24:10 +08:00
1 parent c02fc34d7f
commit fc089927ad
2 files changed
+47 -12

No files matched your search

+20 -1
View File
@@ -279,6 +279,11 @@ export default class Editor extends React.Component<EditorProps, EditorState> {
}
updateNode(id: string) {
this.graph.changeData();
this.graph.layout();
}
render() {
console.log("render editor")
const { curNodeId, treeModel, settings } = this.state;
@@ -295,7 +300,21 @@ export default class Editor extends React.Component<EditorProps, EditorState> {
ref={this.ref}
/>
<Col span={6} className="editorSidebar">
{curNode ? <NodePanel model={curNode} settings={settings} /> : <TreePanel model={treeModel} />}
{
curNode ?
<NodePanel
model={curNode}
settings={settings}
updateNode={id => {
const item = this.graph.findById(id);
item.draw();
}}
/>
:
<TreePanel
model={treeModel}
/>
}
</Col>
</Row>
</div>