Skip to content

Commit 60da479

Browse files
committed
[bugfix] header.update is back
1 parent 2b9b073 commit 60da479

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

src/apis/setHeaderItems.js

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,18 @@ const Header = {
127127
return this;
128128
},
129129
/* rethink update later */
130-
// update(arg) {
131-
// if (typeof arg === 'object') {
132-
// this._updateItem(arg);
133-
// } else if (Array.isArray(arg)) {
134-
// this._updateItems(arg);
135-
// } else {
136-
// console.warn('Argument must be either an object or an array');
137-
// }
130+
update(arg) {
131+
// if (typeof arg === 'object') {
132+
// this._updateItem(arg);
133+
// }
134+
if (Array.isArray(arg)) {
135+
this._updateItems(arg);
136+
} else {
137+
console.warn('Argument must be an array');
138+
}
138139

139-
// return this;
140-
// },
140+
return this;
141+
},
141142
// _updateItem(obj) {
142143
// if (this.index === -1) {
143144
// console.warn('Please use .get(dataElement) first before using update');
@@ -151,11 +152,11 @@ const Header = {
151152

152153
// return this;
153154
// },
154-
// _updateItems(items) {
155-
// this.headers[this.headerGroup] = items;
155+
_updateItems(items) {
156+
this.headers[this.headerGroup] = items;
156157

157-
// return this;
158-
// },
158+
return this;
159+
},
159160
_setIndex(dataElement) {
160161
this.index = this._getIndexOfElement(dataElement);
161162
},

0 commit comments

Comments
 (0)