File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/components/spreadSheet Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -24,19 +24,23 @@ export interface SpreadSheetProps {
24
24
/** 字段类型 */
25
25
type : string ;
26
26
} > ;
27
+ hotTableInstanceRef ?: ( instance : any ) => void ;
27
28
}
28
29
29
30
class SpreadSheet extends React . PureComponent < SpreadSheetProps , any > {
30
31
tableRef : any = React . createRef ( ) ;
31
32
copyUtils = new CopyUtils ( ) ;
32
33
_renderTimer : any ;
33
34
35
+ componentDidMount ( ) {
36
+ this . props . hotTableInstanceRef ?.( this . tableRef . current ) ;
37
+ }
38
+
34
39
componentDidUpdate ( prevProps : any , _prevState : any ) {
35
40
if ( prevProps != this . props ) {
36
41
if ( this . tableRef ) {
37
42
this . removeRenderClock ( ) ;
38
43
this . _renderTimer = setTimeout ( ( ) => {
39
- console . log ( 'render sheet' ) ;
40
44
this . tableRef . current . hotInstance . render ( ) ;
41
45
} , 100 ) ;
42
46
}
You can’t perform that action at this time.
0 commit comments