Properties add shouldUpdate
This commit is contained in:
1 parent
aefb646793
commit
1d1c6fded2
1 file changed
+9
@@ -28,6 +28,14 @@ export default class Properties extends Component<PropertiesProps> {
|
|||||||
treeList: []
|
treeList: []
|
||||||
};
|
};
|
||||||
|
|
||||||
|
curWorkspace: string = '';
|
||||||
|
|
||||||
|
shouldComponentUpdate(nextProps: PropertiesProps) {
|
||||||
|
const shouldUpdate = this.curWorkspace != nextProps.workspace;
|
||||||
|
this.curWorkspace = nextProps.workspace;
|
||||||
|
return shouldUpdate;
|
||||||
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
var workspace = this.props.workspace;
|
var workspace = this.props.workspace;
|
||||||
if (workspace == '') {
|
if (workspace == '') {
|
||||||
@@ -58,6 +66,7 @@ export default class Properties extends Component<PropertiesProps> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
console.log("render Properties");
|
||||||
const { onOpenTree, workspace } = this.props;
|
const { onOpenTree, workspace } = this.props;
|
||||||
const treeList = this.getTreeList(workspace);
|
const treeList = this.getTreeList(workspace);
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in new issue
Block a user