2023-11-08 20:43:18 +08:00
|
|
|
import React from 'react';
|
|
|
|
import { InboxOutlined, PlusOutlined, UploadOutlined } from '@ant-design/icons';
|
|
|
|
import { Button, Space, Upload } from 'antd';
|
2024-01-11 15:55:58 +08:00
|
|
|
import type { UploadFile } from 'antd';
|
2023-11-08 20:43:18 +08:00
|
|
|
|
|
|
|
const { Dragger } = Upload;
|
|
|
|
|
|
|
|
const fileList: UploadFile[] = [
|
|
|
|
{
|
|
|
|
uid: '-1',
|
|
|
|
name: 'image.png',
|
|
|
|
status: 'done',
|
|
|
|
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
uid: '-2',
|
|
|
|
name: 'image.png',
|
|
|
|
status: 'done',
|
|
|
|
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
uid: '-xxx',
|
|
|
|
percent: 50,
|
|
|
|
name: 'image.png',
|
|
|
|
status: 'uploading',
|
|
|
|
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
uid: '-5',
|
|
|
|
name: 'image.png',
|
|
|
|
status: 'error',
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const App: React.FC = () => {
|
|
|
|
const uploadButton = (
|
2023-12-30 15:21:52 +08:00
|
|
|
<button style={{ border: 0, background: 'none' }} type="button">
|
2023-11-08 20:43:18 +08:00
|
|
|
<PlusOutlined />
|
|
|
|
<div style={{ marginTop: 8 }}>Upload</div>
|
2023-12-30 15:21:52 +08:00
|
|
|
</button>
|
2023-11-08 20:43:18 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Space direction="vertical">
|
|
|
|
<Upload disabled>Click Text to Upload</Upload>
|
|
|
|
<Upload disabled>
|
|
|
|
<Button icon={<UploadOutlined />}>Click to Upload</Button>
|
|
|
|
</Upload>
|
|
|
|
<Upload name="avatar" listType="picture-card" fileList={fileList} disabled>
|
|
|
|
{uploadButton}
|
|
|
|
</Upload>
|
|
|
|
<Upload name="avatar" listType="picture-circle" fileList={fileList} disabled>
|
|
|
|
{uploadButton}
|
|
|
|
</Upload>
|
|
|
|
<Dragger disabled>
|
|
|
|
<p className="ant-upload-drag-icon">
|
|
|
|
<InboxOutlined />
|
|
|
|
</p>
|
|
|
|
<p className="ant-upload-text">Click or drag file to this area to upload</p>
|
|
|
|
<p className="ant-upload-hint">
|
|
|
|
Support for a single or bulk upload. Strictly prohibited from uploading company data or
|
|
|
|
other banned files.
|
|
|
|
</p>
|
|
|
|
</Dragger>
|
|
|
|
</Space>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default App;
|