Skip to content

Commit 334d5f0

Browse files
authored
fix: #98034 SpreadSheet props support hotTableInstanceRef (#464)
1 parent d4307de commit 334d5f0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/spreadSheet/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,23 @@ export interface SpreadSheetProps {
2424
/** 字段类型 */
2525
type: string;
2626
}>;
27+
hotTableInstanceRef?: (instance: any) => void;
2728
}
2829

2930
class SpreadSheet extends React.PureComponent<SpreadSheetProps, any> {
3031
tableRef: any = React.createRef();
3132
copyUtils = new CopyUtils();
3233
_renderTimer: any;
3334

35+
componentDidMount() {
36+
this.props.hotTableInstanceRef?.(this.tableRef.current);
37+
}
38+
3439
componentDidUpdate(prevProps: any, _prevState: any) {
3540
if (prevProps != this.props) {
3641
if (this.tableRef) {
3742
this.removeRenderClock();
3843
this._renderTimer = setTimeout(() => {
39-
console.log('render sheet');
4044
this.tableRef.current.hotInstance.render();
4145
}, 100);
4246
}

0 commit comments

Comments
 (0)