Skip to content

Commit

Permalink
docs(Upload): mod limit demo
Browse files Browse the repository at this point in the history
  • Loading branch information
tao1991123 committed Jan 15, 2019
1 parent e173ec6 commit 53a34cf
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions docs/upload/demo/limit.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,29 @@ Waring: `https://www.easy-mock.com/mock/5b713974309d0d7d107a74a3/alifd/upload` A
````jsx
import { Upload, Button } from '@alifd/next';

const onError = (file, fileList) => {
console.log('Exceed limit', file, fileList);
};

ReactDOM.render((
<Upload
action="https://www.easy-mock.com/mock/5b713974309d0d7d107a74a3/alifd/upload"
limit={3}
multiple
listType="text"
defaultValue={[{
name: 'IMG.png',
state: 'done',
size: 1024,
downloadURL: 'https://img.alicdn.com/tps/TB19O79MVXXXXcZXVXXXXXXXXXX-1024-1024.jpg',
fileURL: 'https://img.alicdn.com/tps/TB19O79MVXXXXcZXVXXXXXXXXXX-1024-1024.jpg',
imgURL: 'https://img.alicdn.com/tps/TB19O79MVXXXXcZXVXXXXXXXXXX-1024-1024.jpg'
}]}
>
<Button type="primary" style={{margin: '0 0 10px'}}>Upload File</Button>
</Upload>
<div>
<Upload
action="https://www.easy-mock.com/mock/5b713974309d0d7d107a74a3/alifd/upload"
limit={2}
multiple
listType="text"
onError={onError}
defaultValue={[{
name: 'IMG.png',
state: 'done',
size: 1024,
downloadURL: 'https://img.alicdn.com/tps/TB19O79MVXXXXcZXVXXXXXXXXXX-1024-1024.jpg',
fileURL: 'https://img.alicdn.com/tps/TB19O79MVXXXXcZXVXXXXXXXXXX-1024-1024.jpg',
imgURL: 'https://img.alicdn.com/tps/TB19O79MVXXXXcZXVXXXXXXXXXX-1024-1024.jpg'
}]}>
<Button type="primary" style={{margin: '0 0 10px'}}>Upload File</Button>
</Upload>
</div>
), mountNode);

````

0 comments on commit 53a34cf

Please sign in to comment.