Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<Version>9.0.0</Version>
<Version>9.0.1</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ public class UniverSheetData
public string? CommandName { get; set; }

/// <summary>
/// 获得/设置 数据 默认 null 未设置
/// 获得/设置 表格数据 默认 null 未设置
/// </summary>
/// <remarks>给 UniverSheet Workbook 使用</remarks>
public object? WorkbookData { get; set; }

/// <summary>
/// 获得/设置 附加业务数据 默认 null 未设置
/// </summary>
/// <remarks>给自定义业务使用</remarks>
public object? Data { get; set; }
}
14 changes: 3 additions & 11 deletions src/components/BootstrapBlazor.UniverSheet/wwwroot/univer.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export async function createUniverSheetAsync(sheet) {
const { UniverSheetsDataValidationPlugin } = UniverSheetsDataValidation
const { UniverSheetsDataValidationUIPlugin } = UniverSheetsDataValidationUi
const { defaultTheme } = UniverDesign;

const options = {
theme: sheet.options.theme ?? defaultTheme,
locale: sheet.options.lang ?? LocaleType.ZH_CN,
Expand Down Expand Up @@ -70,16 +70,8 @@ export async function createUniverSheetAsync(sheet) {
...options
});

const { data: { data } = {} } = sheet.options;
if (data) {
const template = typeof data.template === 'string' ? JSON.parse(data.template) : data.template;
template && delete data.template;
univerAPI.createWorkbook(merge({}, template, { customData: data }));
delete sheet.options.data;
}
else {
univerAPI.createUniverSheet();
}
const { workboolData } = sheet.options.data || {};
univerAPI.createWorkbook(workboolData);

sheet.univer = univer;
sheet.univerAPI = univerAPI;
Expand Down