File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed
packages/cascader-panel/src Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,8 @@ export default {
109
109
checkedNodePaths: [],
110
110
store: [],
111
111
menus: [],
112
- activePath: []
112
+ activePath: [],
113
+ loadCount: 0
113
114
};
114
115
},
115
116
@@ -294,6 +295,28 @@ export default {
294
295
dataList && dataList .length && this .store .appendNodes (dataList, parent);
295
296
node .loading = false ;
296
297
node .loaded = true ;
298
+
299
+ // dispose default value on lazy load mode
300
+ if (Array .isArray (this .checkedValue )) {
301
+ const nodeValue = this .checkedValue [this .loadCount ++ ];
302
+ const valueKey = this .config .value ;
303
+ const leafKey = this .config .leaf ;
304
+
305
+ if (Array .isArray (dataList) && dataList .filter (item => item[valueKey] === nodeValue).length > 0 ) {
306
+ const checkedNode = this .store .getNodeByValue (nodeValue);
307
+
308
+ if (! checkedNode .data [leafKey]) {
309
+ this .lazyLoad (checkedNode, () => {
310
+ this .handleExpand (checkedNode);
311
+ });
312
+ }
313
+
314
+ if (this .loadCount === this .checkedValue .length ) {
315
+ this .$parent .computePresentText ();
316
+ }
317
+ }
318
+ }
319
+
297
320
onFullfiled && onFullfiled (dataList);
298
321
};
299
322
config .lazyLoad (node, resolve);
You can’t perform that action at this time.
0 commit comments