Skip to content

Commit 48a6d5c

Browse files
committed
refactor: 撤销 WorkbookData
1 parent c861f75 commit 48a6d5c

2 files changed

Lines changed: 10 additions & 11 deletions

File tree

src/components/BootstrapBlazor.UniverSheet/Components/UniverSheetData.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,7 @@ public class UniverSheetData
2121
public string? CommandName { get; set; }
2222

2323
/// <summary>
24-
/// 获得/设置 表格数据 默认 null 未设置
24+
/// 获得/设置 数据 默认 null 未设置
2525
/// </summary>
26-
/// <remarks>给 UniverSheet Workbook 使用</remarks>
27-
public object? WorkbookData { get; set; }
28-
29-
/// <summary>
30-
/// 获得/设置 附加业务数据 默认 null 未设置
31-
/// </summary>
32-
/// <remarks>给自定义业务使用</remarks>
3326
public object? Data { get; set; }
3427
}

src/components/BootstrapBlazor.UniverSheet/wwwroot/univer.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,15 @@ export async function createUniverSheetAsync(sheet) {
7070
...options
7171
});
7272

73-
const { workboolData } = sheet.options.data || {};
74-
univerAPI.createWorkbook(workboolData);
75-
73+
const { data } = sheet.options.data || {};
74+
if (data) {
75+
const option = typeof data === 'string' ? JSON.parse(data) : data;
76+
univerAPI.createWorkbook(option);
77+
}
78+
else {
79+
univerAPI.createWorkbook();
80+
}
81+
7682
sheet.univer = univer;
7783
sheet.univerAPI = univerAPI;
7884
sheet.dispose = () => {

0 commit comments

Comments
 (0)