Skip to content

Commit 57dbd6a

Browse files
make sure id parameter is type of string
1 parent 484640b commit 57dbd6a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/utils/api/api.factory.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const _apiProps = {
5050
return new (Promise)(resolve => { this.one('_onFlushEffects', function () { resolve.apply(this, arguments); }); });
5151
},
5252
select: function (id = missingParamEr('select')) {
53+
id = id + '';//make sure id is string
5354
const result = this._getOnChangePromise();
5455
this._select(id);
5556
return result;
@@ -83,6 +84,7 @@ const _apiProps = {
8384
return this;
8485
},
8586
open: function (tabObj = missingParamEr('open')) {
87+
tabObj.id = tabObj.id + '';//make sure id is string
8688
const result = this._getOnChangePromise();
8789
this._open(tabObj.id);
8890
this._addTab(tabObj, { defaultPanelComponent: this.getOption('defaultPanelComponent') });
@@ -95,6 +97,7 @@ const _apiProps = {
9597
return result;
9698
},
9799
close: function (id = missingParamEr('close')) {
100+
id = id + '';//make sure id is string
98101
if (this.isSelected(id)) {
99102
const _openTabsId = [...this.stateRef.openTabIDs];
100103
_openTabsId.splice(_openTabsId.indexOf(id), 1);

0 commit comments

Comments
 (0)