File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed
src/BootstrapBlazor.Server/Components/Samples Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 1919 <div class =" bb-sheet-demo" >
2020 <UniverSheet @ref =" _sheetExcel" OnReadyAsync =" OnReadyAsync" ></UniverSheet >
2121 </div >
22+ <section ignore >
23+ <Textarea rows =" 3" readonly Value =" @_jsonData" ></Textarea >
24+ </section >
2225</DemoBlock >
2326
2427<DemoBlock Title =" @Localizer[" PluginTitle " ]"
2932 <Button OnClickWithoutRender =" OnPushPluginData" Text =" @Localizer[" PushButtonText " ]" ></Button >
3033 </section >
3134 <div class =" bb-sheet-demo" >
32- <UniverSheet @ref =" _sheetPlugin" Plugins =" Plugins " OnPostDataAsync =" OnPostDataAsync" ></UniverSheet >
35+ <UniverSheet @ref =" _sheetPlugin" Plugins =" _plugins " OnPostDataAsync =" OnPostDataAsync" ></UniverSheet >
3336 </div >
3437</DemoBlock >
Original file line number Diff line number Diff line change @@ -19,16 +19,20 @@ public partial class UniverSheets
1919 [ Inject , NotNull ]
2020 private IStringLocalizer < UniverSheets > ? Localizer { get ; set ; }
2121
22- private readonly Dictionary < string , string > Plugins = new ( )
22+ private readonly Dictionary < string , string > _plugins = new ( )
2323 {
2424 { "ReportPlugin" , "univer-sheet/plugin.js" }
2525 } ;
2626
27- private UniverSheet _sheetExcel = default ! ;
27+ [ NotNull ]
28+ private UniverSheet ? _sheetExcel = null ;
2829
29- private UniverSheet _sheetPlugin = default ! ;
30+ [ NotNull ]
31+ private UniverSheet ? _sheetPlugin = null ;
3032
31- private static string ? _reportData = default ! ;
33+ private static string ? _reportData = null ;
34+
35+ private string ? _jsonData = null ;
3236
3337 /// <summary>
3438 /// <inheritdoc/>
@@ -72,10 +76,12 @@ await _sheetExcel.PushDataAsync(new UniverSheetData()
7276
7377 private async Task OnSaveExcelData ( )
7478 {
75- var data = await _sheetExcel . PushDataAsync ( new UniverSheetData ( )
79+ var result = await _sheetExcel . PushDataAsync ( new UniverSheetData ( )
7680 {
7781 CommandName = "GetWorkbook"
7882 } ) ;
83+ _jsonData = result ? . Data ? . ToString ( ) ;
84+ StateHasChanged ( ) ;
7985 }
8086
8187 private async Task OnPushPluginData ( )
You can’t perform that action at this time.
0 commit comments