import React from 'react'; import { Card } from 'antd'; import { DetailPanel, withEditorContext } from 'gg-editor'; import { EditorContextProps } from 'gg-editor/lib/components/EditorContext'; import { INode } from '@antv/g6/lib/interface/item'; interface NodePanelProps extends EditorContextProps { curNode: INode | null; } interface NodePanelState { } class Panel extends React.Component { componentDidMount() { } renderNode() { console.log("NodePanel render", this.props); const { curNode } = this.props; return (
{curNode.getModel().label}
) } render() { console.log("NodePanel render", this.props); const { curNode } = this.props; return ( {curNode ? this.renderNode() : "未选中"} ) } } export default withEditorContext(Panel);