Commit ae01a0cf authored by 张烨's avatar 张烨

fix: upload 随props更新

parent fae711e7
......@@ -61,6 +61,26 @@ class PicturesWall extends React.Component<PicturesWallType> {
}] as UploadFile<any>[] : [],
};
getDerivedStateFromProps = (props, state) => {
const fileList = state.fileList;
if(fileList.length === 0){
return {
fileList: Array.isArray(props.value) ? props.value.map((v) => ({
url: v,
uid: uuid(8, 16),
name: '熊猫运维中台系统',
status: 'done',
})) as UploadFile<any>[]: [{
url: props.value,
uid: uuid(8, 16),
name: '熊猫运维中台系统',
status: 'done',
}] as UploadFile<any>[]
}
}
return null;
}
update = () =>{
if(this.props.value){
this.setState({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment