Skip to content

Commit 2ca6a99

Browse files
committed
feat(Cascader): loadData add argument source data
1 parent 477d687 commit 2ca6a99

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/cascader/cascader.jsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export default class Cascader extends Component {
217217
const loop = (data, prefix = '0') => data.forEach((item, index) => {
218218
const { value, children } = item;
219219
const pos = `${prefix}-${index}`;
220-
this._v2n[value] = this._p2n[pos] = { ...item, pos };
220+
this._v2n[value] = this._p2n[pos] = { ...item, pos, _source: item };
221221

222222
if (children && children.length) {
223223
loop(children, pos);
@@ -490,7 +490,8 @@ export default class Cascader extends Component {
490490

491491
const { loadData } = this.props;
492492
if (canExpand && loadData) {
493-
return loadData(this._v2n[value]).then(callback);
493+
const data = this._v2n[value];
494+
return loadData(data, data._source).then(callback);
494495
} else {
495496
callback();
496497
}

0 commit comments

Comments
 (0)