File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
packages/cascader-panel/src Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,8 @@ const checkNode = el => {
79
79
}
80
80
};
81
81
82
+ let loadCount = 0 ;
83
+
82
84
export default {
83
85
name: ' ElCascaderPanel' ,
84
86
@@ -294,6 +296,24 @@ export default {
294
296
dataList && dataList .length && this .store .appendNodes (dataList, parent);
295
297
node .loading = false ;
296
298
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
+
297
317
onFullfiled && onFullfiled (dataList);
298
318
};
299
319
config .lazyLoad (node, resolve);
You can’t perform that action at this time.
0 commit comments