diff --git a/packages/react/src/components/Workbook/api.ts b/packages/react/src/components/Workbook/api.ts index 0c78790b..b93ed2db 100644 --- a/packages/react/src/components/Workbook/api.ts +++ b/packages/react/src/components/Workbook/api.ts @@ -312,11 +312,9 @@ export function generateAPIs( handleUndo, handleRedo, - calculateFormula: () => { + calculateFormula: (id?: string, range?: SingleRange) => { setContext((draftCtx) => { - _.forEach(draftCtx.luckysheetfile, (sheet_obj) => { - api.calculateFormula(draftCtx, sheet_obj.id as string); - }); + api.calculateFormula(draftCtx, id, range); }); },