diff --git a/examples/docs/en-US/input.md b/examples/docs/en-US/input.md index b23536b2c..4260ece58 100644 --- a/examples/docs/en-US/input.md +++ b/examples/docs/en-US/input.md @@ -324,7 +324,7 @@ Prepend or append an element, generally a label or a button. - + diff --git a/examples/docs/en-US/upload.md b/examples/docs/en-US/upload.md index dee24fe4d..e6b595a8f 100644 --- a/examples/docs/en-US/upload.md +++ b/examples/docs/en-US/upload.md @@ -113,6 +113,9 @@ }, handleChange(file, fileList) { this.fileList3 = fileList.slice(-3); + }, + handleExceed(files, fileList) { + this.$message.warning(`You can upload up to 3 files. You selected ${files.length} files this time, and ${files.length + fileList.length} files totally`); } } } @@ -123,13 +126,16 @@ Upload files by clicking or drag-and-drop ### Click to upload files -:::demo Customize upload button type and text using `slot`. +:::demo Customize upload button type and text using `slot`. Set `limit` and `on-exceed` to limit the maximum number of uploads allowed and specify method when the limit is exceeded. ```html Click to upload
jpg/png files with a size less than 500kb
@@ -147,6 +153,9 @@ Upload files by clicking or drag-and-drop }, handlePreview(file) { console.log(file); + }, + handleExceed(files, fileList) { + this.$message.warning(`The limit is 3, you selected ${files.length} files this time, add up to ${files.length + fileList.length} totally`); } } } @@ -407,6 +416,8 @@ list-type | type of fileList | string | text/picture/picture-card | text | auto-upload | whether to auto upload file | boolean | — | true | http-request | override default xhr behavior, allowing you to implement your own upload-file's request | function | — | — | disabled | whether to disable upload | boolean | — | false | +limit | maximum number of uploads allowed | number | — | — | +on-exceed | hook function when limit is exceeded | function(files, fileList) | — | - | ### Methods | Methods Name | Description | Parameters | diff --git a/examples/docs/zh-CN/input.md b/examples/docs/zh-CN/input.md index 5c613787f..7de9b448c 100644 --- a/examples/docs/zh-CN/input.md +++ b/examples/docs/zh-CN/input.md @@ -350,7 +350,7 @@ export default { - +