How can the ant design mobile of react upload only one picture?

For uploading pictures on

ant design mobile, how to display only one upload selector? as soon as you use it, four will come out.

complement: `< ImagePicker

   files={files}
   onChange={this.onChange}
   onImageClick={(index, fs) => console.log(index, fs)}
   selectable={files.length < 5}
   accept="image/gif,image/jpeg,image/jpg,image/png"
    />`

is that I just want the one with the cross on the left and center it. You can only upload one picture at a time. You can preview it

.

solve

Mar.02,2021

that's fine. You can do the outside style by yourself.
multiple= {true} means that after you click on the upload box, you can choose one or more pictures at a time, and false can only upload them one by one

.
class ImagePickerExample extends React.Component {
  state = {
    files: [],
  }
  onChange = (files, type, index) => {
    console.log(files, type, index);
    this.setState({
      files,
    });
  }

  render() {
    const { files } = this.state;
    return (
      <div>
        <ImagePicker
          files={files}
          onChange={this.onChange}
          onImageClick={(index, fs) => console.log(index, fs)}
          selectable={files.length < 1}
          accept="image/gif,image/jpeg,image/jpg,image/png"
        />
      </div>
    );
  }
}

ReactDOM.render(<ImagePickerExample />, mountNode);

I don't understand. Can I paste the code and page?

Menu