错误:Warning: [antd: Upload] value is not a valid prop, do you mean fileList
?
然后在Form.Item加上valuePropName="fileList"属性后,初始化组件正常,但是点击上传文件就会报错item.map is not a function , 出现了空指针错误
则需要在Form.Item中加上getValueFromEvent={normFile}
const normFile = (e) => { //如果是typescript, 那么参数写成 e: any
console.log('Upload event:', e);
if (Array.isArray(e)) {
return e;
}
return e && e.fileList;
};