Commit 95eacae1 authored by 张烨's avatar 张烨

fix: upload回显报错

parent e3d514ba
......@@ -22,6 +22,7 @@ module.exports = {
sourceType: 'module',
ecmaFeatures: {
jsx: true,
tsx: true,
},
},
rules: {
......
......@@ -63,7 +63,8 @@ class PicturesWall extends React.Component<PicturesWallType> {
static getDerivedStateFromProps = (props, state) => {
const fileList = state.fileList;
if(fileList.length === 0 && props.value){
const shouldUpdate = props.value && fileList.every(f => Array.isArray(props.value) ? !props.value.some(v => f.url === v) : f.url !== props.value)
if(fileList.length === 0 && props.value && shouldUpdate){
return {
fileList: Array.isArray(props.value) ? props.value.map((v) => ({
url: v,
......
......@@ -253,10 +253,12 @@ export const getDefaultGetWebconfig = ({
],
},
};
if (initialValues) {
Object.keys(config).forEach(k => {
if (initialValues[k]) {
config[k].initialValue = initialValues[k];
}
});
}
return config;
};
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