File tree 3 files changed +8
-6
lines changed
3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,8 @@ import * as React from 'react';
10
10
import { IFolderTree } from 'mo/model' ;
11
11
import { ExplorerView , FolderTreeView } from 'mo/workbench/sidebar/explore' ;
12
12
import { IActionBarItem } from 'mo/components/actionBar' ;
13
-
13
+ // TODO: 自依赖问题 connect 失效,暂时手动引入 Controller 往 View 层传递
14
+ import { folderTreeController , explorerController } from 'mo/controller' ;
14
15
export interface IExplorerController {
15
16
onHeaderToolbarClick ?: ( e : React . MouseEvent , item : IActionBarItem ) => void ;
16
17
}
@@ -42,7 +43,7 @@ export class ExplorerController
42
43
id : 'explore' ,
43
44
title : 'EXPLORER' ,
44
45
render ( ) {
45
- return < ExplorerView /> ;
46
+ return < ExplorerView { ... explorerController } /> ;
46
47
} ,
47
48
} ;
48
49
@@ -128,7 +129,7 @@ export class ExplorerController
128
129
data : explorerState . folderTree ?. data ,
129
130
contextMenu : explorerState . folderTree ?. contextMenu ,
130
131
} ;
131
- return < FolderTreeView { ...folderProps } /> ;
132
+ return < FolderTreeView { ...folderProps } { ... folderTreeController } /> ;
132
133
} ,
133
134
} ;
134
135
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ export const Explorer: React.FunctionComponent<IExplorer> = (
12
12
props : IExplorer & IExplorerController
13
13
) => {
14
14
const { data = [ ] , headerToolBar = [ ] , onHeaderToolbarClick } = props ;
15
+ console . log ( 'Explorer => ExplorerController' , props )
15
16
return (
16
17
< div className = { defaultExplorerClassName } >
17
18
< Header
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ const FolderTree: React.FunctionComponent<IFolderTree> = (
22
22
onClickContextMenu,
23
23
...restProps
24
24
} = props ;
25
-
25
+ console . log ( 'FolderTree => FolderTreeController' , props )
26
26
const inputRef = useRef < any > ( null ) ;
27
27
28
28
const contextView = useContextView ( ) ;
@@ -87,8 +87,8 @@ const FolderTree: React.FunctionComponent<IFolderTree> = (
87
87
onBlur = { handleInputBlur }
88
88
/>
89
89
) : (
90
- name
91
- ) ;
90
+ name
91
+ ) ;
92
92
} ;
93
93
94
94
const renderByData = (
You can’t perform that action at this time.
0 commit comments