Browse Source

BI-146095 fix:文本下拉加载最后一次缓存时cachegroup新增了

master^2^2
chenzeyu 8 months ago
parent
commit
fdb47604f7
  1. 6
      packages/fineui/src/widget/multiselect/loader.js

6
packages/fineui/src/widget/multiselect/loader.js

@ -74,7 +74,7 @@ export class MultiSelectInnerLoader extends Widget {
this.next.setLoaded();
const items = this._composeItems(this.cachItems.slice(0, 100));
this.cachItems = this.cachItems.slice(100);
this.addItems(items);
this.addItems(items, true);
return;
}
@ -183,7 +183,7 @@ export class MultiSelectInnerLoader extends Widget {
]);
}
addItems(items) {
addItems(items, isFromCache = false) {
this.count += items.length;
if (isObject(this.next)) {
if (this.hasNext()) {
@ -194,7 +194,7 @@ export class MultiSelectInnerLoader extends Widget {
}
}
// cacheGroup渲染的是全量的,如果这次加载更多add的items是从cacheItems里面拿的,那不用再add了
if (this.cachItems.length > 0) {
if (isFromCache) {
this.button_group.addItems(...arguments);
return;
}

Loading…
Cancel
Save