Skip to content

Commit dd08b2f

Browse files
committed
refactor: 增加 doTask 客户端脚本
1 parent 09610c4 commit dd08b2f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/BootstrapBlazor.Server/Components/Layout/BaseLayout.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ protected override async Task OnInitializedAsync()
7676
await base.OnInitializedAsync();
7777

7878
var module = await JSRuntime.LoadModule($"{WebsiteOption.Value.JSModuleRootPath}Layout/BaseLayout.razor.js");
79-
await module.InvokeVoidAsync("initTheme");
79+
await module.InvokeVoidAsync("doTask");
8080
_init = true;
8181
}
8282

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import { getTheme, setTheme } from "../../_content/BootstrapBlazor/modules/utility.js"
22

3-
export function initTheme() {
3+
function initTheme() {
44
const currentTheme = getTheme();
55
setTheme(currentTheme, false);
66
}
7+
8+
export function doTask() {
9+
initTheme();
10+
}

0 commit comments

Comments
 (0)