feat: tree selectd support

This commit is contained in:
duanhongbo committed 2020-12-04 11:59:33 +08:00
1 parent 8c5e43b9e7
commit 40b83c2876
4 files changed
+40 -11

No files matched your search

+8
View File
@@ -29,6 +29,7 @@ export default class Main extends Component {
settings: Settings;
tabs: TreeTabs;
explorer: Explorer;
session = 0;
componentDidMount() {
@@ -88,6 +89,9 @@ export default class Main extends Component {
<Sider className="sider" width={250}>
{workdir !== "" ? (
<Explorer
ref={(ref) => {
this.explorer = ref;
}}
workdir={workdir}
onOpenTree={(path) => {
this.tabs.openFile(path);
@@ -105,6 +109,10 @@ export default class Main extends Component {
ref={(ref) => {
this.tabs = ref;
}}
onTabSelected={(path)=>{
this.explorer.selectNode(path);
}
}
/>
</Content>
</Layout>