Skip to content

Commit 9e542ab

Browse files
ArgoZhangyc-2503RongguoLiu
authored
feat(Utility): improve registerBootstrapBlazorModule method (#5936)
* chore: bump version 9.6.1-beta01 Co-Authored-By: Chason <[email protected]> Co-Authored-By: RongguoLiu <[email protected]> * refactor: 优化 registerBootstrapBlazorModule 方法 --------- Co-authored-by: Chason <[email protected]> Co-authored-by: RongguoLiu <[email protected]>
1 parent 248f88d commit 9e542ab

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/BootstrapBlazor/BootstrapBlazor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>9.6.0</Version>
4+
<Version>9.6.1-beta01</Version>
55
</PropertyGroup>
66

77
<ItemGroup>

src/BootstrapBlazor/wwwroot/modules/utility.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -822,17 +822,21 @@ export function registerBootstrapBlazorModule(name, identifier, callback) {
822822
}
823823
if (this._init === false) {
824824
this._init = true;
825-
cb(this);
825+
if (isFunction(cb)) {
826+
cb(this);
827+
}
826828
}
827829
return this;
828830
},
829831
dispose: function (id, cb) {
830832
if (id) {
831833
this._items = this._items.filter(item => item !== id);
832834
}
833-
if (this._items.length === 0 && cb) {
835+
if (this._items.length === 0) {
834836
this._init = false;
835-
cb(this);
837+
if (isFunction(cb)) {
838+
cb(this);
839+
}
836840
}
837841
}
838842
};

0 commit comments

Comments
 (0)