Skip to content

Commit 7a76fab

Browse files
committed
refactor: 增加 registerBootstrapBlazorModule 方法
1 parent c0c9596 commit 7a76fab

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/BootstrapBlazor/wwwroot/modules/utility.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,11 @@ const deepMerge = (obj1, obj2, skipNull = true) => {
820820
return obj1;
821821
}
822822

823+
export function registerBootstrapBlazorModule(name, module) {
824+
window.BootstrapBlazor ??= {};
825+
window.BootstrapBlazor[name] ??= deepMerge(window.BootstrapBlazor[name] ?? {}, module);
826+
}
827+
823828
export function setTitle(title) {
824829
document.title = title;
825830
}

0 commit comments

Comments
 (0)