Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix(facade): set default style (#4613)

Dushusir4d1f5d1c5360
diff --git a/packages/sheets/src/facade/f-worksheet.ts b/packages/sheets/src/facade/f-worksheet.ts
index 3bc72ab034..87beda6130 100644
--- a/packages/sheets/src/facade/f-worksheet.ts
+++ b/packages/sheets/src/facade/f-worksheet.ts
@@ -201,9 +201,11 @@ export class FWorksheet extends FBaseInitialable {
* const fWorkbook = univerAPI.getActiveWorkbook();
* const fWorksheet = fWorkbook.getActiveSheet();
* fWorksheet.setDefaultStyle('default');
+ * // or
+ * // fWorksheet.setDefaultStyle({fs: 12, ff: 'Arial'});
* ```
*/
- setDefaultStyle(style: string): FWorksheet {
+ setDefaultStyle(style: string | Nullable<IStyleData>): FWorksheet {
const unitId = this._workbook.getUnitId();
const subUnitId = this._worksheet.getSheetId();
this._commandService.syncExecuteCommand(SetWorksheetDefaultStyleMutation.id, {
@@ -225,6 +227,8 @@ export class FWorksheet extends FBaseInitialable {
* const fWorkbook = univerAPI.getActiveWorkbook();
* const fWorksheet = fWorkbook.getActiveSheet();
* fWorksheet.setRowDefaultStyle(0, 'default');
+ * // or
+ * // fWorksheet.setRowDefaultStyle(0, {fs: 12, ff: 'Arial'});
* ```
*/
setColumnDefaultStyle(index: number, style: string | Nullable<IStyleData>): FWorksheet {
@@ -255,6 +259,8 @@ export class FWorksheet extends FBaseInitialable {
* const fWorkbook = univerAPI.getActiveWorkbook();
* const fWorksheet = fWorkbook.getActiveSheet();
* fWorksheet.setColumnDefaultStyle(0, 'default');
+ * // or
+ * // fWorksheet.setColumnDefaultStyle(0, {fs: 12, ff: 'Arial'});
* ```
*/
setRowDefaultStyle(index: number, style: string | Nullable<IStyleData>): FWorksheet {