mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-03 16:39:41 +08:00
12 lines
311 B
JavaScript
12 lines
311 B
JavaScript
|
export default function getFileItem(file, fileList) {
|
||
|
let matchWay = (!file.uid) ? 'byName' : 'byUid';
|
||
|
let target = fileList.filter((item) => {
|
||
|
if (matchWay === 'byName') {
|
||
|
return item.filename === file.filename;
|
||
|
} else {
|
||
|
return item.uid === file.uid;
|
||
|
}
|
||
|
})[0];
|
||
|
return target;
|
||
|
};
|