Skip to content

Commit 117bcc6

Browse files
author
cl199793
committed
fix issue
1 parent d983bc6 commit 117bcc6

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

packages/cascader-panel/src/cascader-panel.vue

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ const checkNode = el => {
7979
}
8080
};
8181
82+
let loadCount = 0;
83+
8284
export default {
8385
name: 'ElCascaderPanel',
8486
@@ -294,6 +296,24 @@ export default {
294296
dataList && dataList.length && this.store.appendNodes(dataList, parent);
295297
node.loading = false;
296298
node.loaded = true;
299+
300+
// dispose default value on lazy load mode
301+
if (this.checkedValue && Array.isArray(this.checkedValue)) {
302+
const nodeValue = this.checkedValue.slice(loadCount++).shift();
303+
const valueKey = this.config.value;
304+
305+
if (Array.isArray(dataList) && dataList.filter(item => item[valueKey] === nodeValue).length > 0) {
306+
const checkedNode = this.store.getNodeByValue(nodeValue);
307+
this.lazyLoad(checkedNode, () => {
308+
this.handleExpand(checkedNode);
309+
});
310+
311+
if (loadCount === this.checkedValue.length) {
312+
this.$parent.computePresentText();
313+
}
314+
}
315+
}
316+
297317
onFullfiled && onFullfiled(dataList);
298318
};
299319
config.lazyLoad(node, resolve);

0 commit comments

Comments
 (0)