File tree Expand file tree Collapse file tree
src/components/BootstrapBlazor.UniverSheet/wwwroot Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,9 +32,10 @@ export async function createUniverSheetAsync(sheet) {
3232 const { UniverSheetsDataValidationPlugin } = UniverSheetsDataValidation
3333 const { UniverSheetsDataValidationUIPlugin } = UniverSheetsDataValidationUi
3434 const { defaultTheme } = UniverDesign ;
35+
3536 const options = {
36- theme : defaultTheme ,
37- locale : LocaleType . ZH_CN ,
37+ theme : sheet . options . theme ?? defaultTheme ,
38+ locale : sheet . options . lang ?? LocaleType . ZH_CN ,
3839 locales : {
3940 [ LocaleType . ZH_CN ] : merge (
4041 { } ,
@@ -69,9 +70,11 @@ export async function createUniverSheetAsync(sheet) {
6970 ...options
7071 } ) ;
7172
72- const { data } = sheet . options ;
73+ const { data : { data } = { } } = sheet . options ;
7374 if ( data ) {
74- univerAPI . createWorkbook ( typeof data . data === 'object' ? data . data : JSON . parse ( data . 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 } ) ) ;
7578 delete sheet . options . data ;
7679 }
7780 else {
You can’t perform that action at this time.
0 commit comments