File tree Expand file tree Collapse file tree 5 files changed +45
-2
lines changed
src/BootstrapBlazor.Server Expand file tree Collapse file tree 5 files changed +45
-2
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,11 @@ protected override async Task OnInitializedAsync()
110110 {
111111 Text = Localizer [ "OnlineSheet" ] ,
112112 Url = "tutorials/online-sheet" ,
113+ } ,
114+ new ( )
115+ {
116+ Text = Localizer [ "MemorialMode" ] ,
117+ Url = "tutorials/memorial" ,
113118 }
114119 ] ) ;
115120 }
Original file line number Diff line number Diff line change 1+ @page " /tutorials/memorial"
2+
3+ <Button Text =" 切换哀悼模式" OnClick =" OnToggle" class =" mb-3" ></Button >
4+
5+ <p class =" code-label" >1. 加载 <code >Utlity</code > 工具</p >
6+ <Pre >var module = await JSRuntime.LoadUtility();</Pre >
7+
8+ <p class =" code-label" >2. 设置哀悼模式</p >
9+ <Pre >await module.InvokeVoidAsync("SetMemorial", true);</Pre >
Original file line number Diff line number Diff line change 1+ // Licensed to the .NET Foundation under one or more agreements.
2+ // The .NET Foundation licenses this file to you under the Apache 2.0 License
3+ // See the LICENSE file in the project root for more information.
4+ // Maintainer: Argo Zhang([email protected] ) Website: https://www.blazor.zone 5+
6+ using Microsoft . JSInterop ;
7+
8+ namespace BootstrapBlazor . Server . Components . Samples . Tutorials ;
9+
10+ /// <summary>
11+ /// 追悼模式
12+ /// </summary>
13+ public partial class Memorial
14+ {
15+ [ Inject , NotNull ]
16+ private IJSRuntime ? JSRuntime { get ; set ; }
17+
18+ private bool _isMemorial = false ;
19+
20+ private async Task OnToggle ( )
21+ {
22+ var module = await JSRuntime . LoadUtility ( ) ;
23+
24+ _isMemorial = ! _isMemorial ;
25+ await module . SetMemorialModeAsync ( _isMemorial ) ;
26+ }
27+ }
Original file line number Diff line number Diff line change 2222 "TranslateSummary": "Translate",
2323 "DrawingSummary": "Drawing",
2424 "AdminSummary": "Admin",
25- "OnlineSheet": "UniverSheet"
25+ "OnlineSheet": "UniverSheet",
26+ "MemorialMode": "Memorial"
2627 },
2728 "BootstrapBlazor.Server.Components.Components.Pre": {
2829 "LoadingText": "Loading ...",
Original file line number Diff line number Diff line change 2222 "TranslateSummary" : " 翻译工具 Translate" ,
2323 "DrawingSummary" : " 画图 Drawing" ,
2424 "AdminSummary" : " 中台 Admin" ,
25- "OnlineSheet" : " 在线表格 UniverSheet"
25+ "OnlineSheet" : " 在线表格 UniverSheet" ,
26+ "MemorialMode" : " 追悼模式"
2627 },
2728 "BootstrapBlazor.Server.Components.Components.Pre" : {
2829 "LoadingText" : " 正在加载 ..." ,
You can’t perform that action at this time.
0 commit comments