Skip to content

Commit 8e4fced

Browse files
committed
refactor: 移动逻辑到插件里
1 parent 8bc4ce3 commit 8e4fced

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

  • src/components/BootstrapBlazor.UniverSheet/wwwroot

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

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

73-
const { data: { data } = {} } = sheet.options;
73+
const { data } = sheet.options;
7474
if (data) {
75-
const template = typeof data.template === 'string' ? JSON.parse(data.template) : data.template;
76-
template && delete data.template;
77-
univerAPI.createWorkbook(merge({}, template, { customData: data }));
78-
delete sheet.options.data;
75+
const { messageName, commandName, data } = data;
76+
if (messageName === null && commandName === null && data) {
77+
univerAPI.createWorkbook(data);
78+
}
7979
}
8080
else {
8181
univerAPI.createUniverSheet();

0 commit comments

Comments
 (0)