docs: improve upload demos (#35104)

* docs: improve upload demos

* Update drag-sorting.md
This commit is contained in:
afc163 2022-04-20 09:48:26 +08:00 committed by GitHub
parent f180ec6df5
commit 1349b99122
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 12 additions and 19 deletions

View File

@ -84,12 +84,5 @@ class Avatar extends React.Component {
}
}
export default () => <Avatar />;
```
```css
.avatar-uploader > .ant-upload {
width: 128px;
height: 128px;
}
export default Avatar;
```

View File

@ -135,7 +135,7 @@ const DragSortingUpload = () => {
);
};
export default () => <DragSortingUpload />;
export default DragSortingUpload;
```
```css

View File

@ -35,7 +35,7 @@ function getBase64(file) {
});
}
class PicturesWall extends React.Component {
class App extends React.Component {
state = {
previewVisible: false,
previewImage: '',
@ -139,5 +139,5 @@ class PicturesWall extends React.Component {
}
}
export default () => <PicturesWall />;
export default App;
```

View File

@ -25,7 +25,7 @@ You can gain full control over filelist by configuring `fileList`. You can accom
import { Upload, Button } from 'antd';
import { UploadOutlined } from '@ant-design/icons';
class MyUpload extends React.Component {
class App extends React.Component {
state = {
fileList: [
{
@ -70,5 +70,5 @@ class MyUpload extends React.Component {
}
}
export default () => <MyUpload />;
export default App;
```

View File

@ -26,7 +26,7 @@ function getBase64(file) {
});
}
class PicturesWall extends React.Component {
class App extends React.Component {
state = {
previewVisible: false,
previewImage: '',
@ -119,5 +119,5 @@ class PicturesWall extends React.Component {
}
}
export default () => <PicturesWall />;
export default App;
```

View File

@ -18,7 +18,7 @@ import React, { useState } from 'react';
import { Upload, Button, message } from 'antd';
import { UploadOutlined } from '@ant-design/icons';
const Uploader = () => {
const App = () => {
const props = {
beforeUpload: file => {
const isPNG = file.type === 'image/png';
@ -38,5 +38,5 @@ const Uploader = () => {
);
};
export default () => <Uploader />;
export default App;
```

View File

@ -112,7 +112,7 @@ class AliyunOSSUpload extends React.Component {
}
}
const FormPage = () => (
const App = () => (
<Form labelCol={{ span: 4 }}>
<Form.Item label="Photos" name="photos">
<AliyunOSSUpload />
@ -120,5 +120,5 @@ const FormPage = () => (
</Form>
);
export default () => <FormPage />;
export default App;
```