Skip to content

Commit 00ab76b

Browse files
fix: 🐛 修复 Upload 多选时配置为覆盖上传图片达到上限无法替换图片的问题
1 parent 57d89f3 commit 00ab76b

File tree

2 files changed

+2
-36
lines changed

2 files changed

+2
-36
lines changed

docs/en-US/component/use-upload.md

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -77,43 +77,9 @@ abort()
7777
| compressed | Whether to compress video | boolean | true | - |
7878
| maxDuration | Maximum video duration (seconds) | number | 60 | - |
7979
| camera | Camera direction | 'back' \| 'front' | 'back' | - |
80-
| extension | Filter by file extension (H5 supports all types, WeChat Mini Program supports filtering when all and file, other platforms do not support) | string[] | - |
80+
| extension | Filter by file extension (H5 supports all types; WeChat Mini Program supports filtering when accept is 'all' or 'file'; other platforms do not support) | string[] | - | - |
8181

82-
## File Selection Quantity Limits
83-
84-
Different platforms have different limits on file selection quantity, which are determined by the uni-app platform APIs themselves:
85-
86-
### WeChat Platform
87-
88-
| Selection Method | Max Count | Description | Use Case |
89-
|-----------------|-----------|-------------|----------|
90-
| `chooseMedia` | 20 | Maximum selection count for images and videos | Used when accept is `image`, `video`, `media` |
91-
| `chooseMessageFile` | 100 | Maximum selection count for files | Used when accept is `file`, `all` |
92-
93-
### H5 Platform
94-
95-
| Selection Method | Max Count | Description | Use Case |
96-
|-----------------|-----------|-------------|----------|
97-
| `chooseImage` | 9 | Maximum selection count for images | Used when accept is `image` |
98-
| `chooseVideo` | 1 | Does not support multiple selection, single file only | Used when accept is `video` |
99-
| `chooseFile` | 100 | Maximum selection count for files | Used when accept is `all` |
100-
101-
::: warning H5 Platform Special Note
102-
The behavior of the count value on the H5 platform is based on the browser's own specifications. Current test results show that it can only limit single/multiple selection, but cannot limit the specific quantity. Moreover, very few mobile browsers actually support multiple selection.
103-
:::
104-
105-
### Other Platforms
10682

107-
| Selection Method | Max Count | Description | Use Case |
108-
|-----------------|-----------|-------------|----------|
109-
| `chooseImage` | 9 | Maximum selection count for images | Used when accept is `image` |
110-
| `chooseVideo` | 1 | Does not support multiple selection, single file only | Used when accept is `video` |
111-
112-
::: tip Tips
113-
- WeChat platform prioritizes `chooseMedia` and `chooseMessageFile`, which have higher selection count limits
114-
- Video selection does not support multiple selection on most platforms
115-
- The actual selectable quantity is further limited by the `maxCount` parameter
116-
:::
11783

11884
## File Selection Quantity Limits
11985

src/uni_modules/wot-design-uni/components/wd-upload/wd-upload.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ function onChooseFile(currentIndex?: number) {
410410
const { multiple, maxSize, accept, sizeType, limit, sourceType, compressed, maxDuration, camera, beforeUpload, extension } = props
411411
412412
chooseFile({
413-
multiple,
413+
multiple: isDef(currentIndex) ? false : multiple,
414414
sizeType,
415415
sourceType,
416416
maxCount: limit ? limit - uploadFiles.value.length : limit,

0 commit comments

Comments
 (0)