From ef6433d81c576db8b55715a14a574a6d392478df Mon Sep 17 00:00:00 2001
From: 810505339 <810505339@qq.com>
Date: Mon, 23 Sep 2024 11:26:53 +0800
Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E2=9C=A8=20Upload=E6=96=B0?=
=?UTF-8?q?=E5=A2=9Epreview-cover=E6=8F=92=E6=A7=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/component/upload.md | 20 ++++++++++++++++++
src/pages/upload/Index.vue | 21 ++++++++++++++++++-
.../components/wd-upload/wd-upload.vue | 2 ++
3 files changed, 42 insertions(+), 1 deletion(-)
diff --git a/docs/component/upload.md b/docs/component/upload.md
index e7b884e9b..e0acb7e59 100644
--- a/docs/component/upload.md
+++ b/docs/component/upload.md
@@ -567,6 +567,25 @@ const customUpload: UploadMethod = (file, formData, options) => {
}
```
+
+## 自定义预览样式
+
+使用 `preview-cover` 插槽可以自定义覆盖在预览区域上方的内容
+
+```html
+
+
+ {{ file.name }}
+
+
+
+```
+
## Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 | 最低版本 |
@@ -630,6 +649,7 @@ const customUpload: UploadMethod = (file, formData, options) => {
| name | 说明 | 最低版本 |
| ------- | ---------------- | -------- |
| default | 上传唤起插槽样式 | - |
+| preview-cover | 自定义覆盖在预览区域上方的内容 | - |
## Events
diff --git a/src/pages/upload/Index.vue b/src/pages/upload/Index.vue
index 0245a5863..19ef9ae9b 100644
--- a/src/pages/upload/Index.vue
+++ b/src/pages/upload/Index.vue
@@ -73,6 +73,14 @@
+
+
+
+
+ {{ file.name }}
+
+
+
-
+
diff --git a/src/uni_modules/wot-design-uni/components/wd-upload/wd-upload.vue b/src/uni_modules/wot-design-uni/components/wd-upload/wd-upload.vue
index 0950fc17f..e4bc1f4ee 100644
--- a/src/uni_modules/wot-design-uni/components/wd-upload/wd-upload.vue
+++ b/src/uni_modules/wot-design-uni/components/wd-upload/wd-upload.vue
@@ -64,6 +64,8 @@
custom-class="wd-upload__close"
@click="removeFile(index)"
>
+
+
From c13e6058a2c665c174806aebd353294113c4007e Mon Sep 17 00:00:00 2001
From: 810505339 <810505339@qq.com>
Date: Mon, 23 Sep 2024 15:32:43 +0800
Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8DUpl?=
=?UTF-8?q?oad=E6=96=87=E4=BB=B6=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=89=BE?=
=?UTF-8?q?=E4=B8=8D=E5=88=B0=E6=96=87=E4=BB=B6,=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/component/upload.md | 12 +++++++++---
src/pages/upload/Index.vue | 7 ++++---
.../components/wd-upload/wd-upload.vue | 3 +--
3 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/docs/component/upload.md b/docs/component/upload.md
index e0acb7e59..e70fe2ce7 100644
--- a/docs/component/upload.md
+++ b/docs/component/upload.md
@@ -573,9 +573,10 @@ const customUpload: UploadMethod = (file, formData, options) => {
使用 `preview-cover` 插槽可以自定义覆盖在预览区域上方的内容
```html
-
-
- {{ file.name }}
+
+
+
+ {{ file?.name||`文件${index+1}` }}
```
+```typescript
+const fileList = ref([])
+const action: string = 'https://mockapi.eolink.com/zhTuw2P8c29bc981a741931bdd86eb04dc1e8fd64865cb5/upload'
+```
+
## Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 | 最低版本 |
diff --git a/src/pages/upload/Index.vue b/src/pages/upload/Index.vue
index 19ef9ae9b..ba2463fdd 100644
--- a/src/pages/upload/Index.vue
+++ b/src/pages/upload/Index.vue
@@ -75,9 +75,10 @@
-
-
- {{ file.name }}
+
+
+
+ {{ file.name || `文件${index}` }}
diff --git a/src/uni_modules/wot-design-uni/components/wd-upload/wd-upload.vue b/src/uni_modules/wot-design-uni/components/wd-upload/wd-upload.vue
index e4bc1f4ee..b9c15efae 100644
--- a/src/uni_modules/wot-design-uni/components/wd-upload/wd-upload.vue
+++ b/src/uni_modules/wot-design-uni/components/wd-upload/wd-upload.vue
@@ -65,7 +65,7 @@
@click="removeFile(index)"
>
-
+
@@ -566,7 +566,6 @@ function handlePreviewFile(file: UploadFileItem) {
function handlePreviewImage(index: number, lists: string[]) {
const { onPreviewFail } = props
uni.previewImage({
- file,
urls: lists,
current: lists[index],
fail() {
From 52f9bf654b26a09c20b7118efb331f7e6228ea79 Mon Sep 17 00:00:00 2001
From: 810505339 <810505339@qq.com>
Date: Wed, 25 Sep 2024 11:36:05 +0800
Subject: [PATCH 3/3] =?UTF-8?q?docs:=20=E2=9C=8F=EF=B8=8F=20=20Upload?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0preview-cover=E6=9C=80=E4=BD=8E=E7=89=88?=
=?UTF-8?q?=E6=9C=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/component/upload.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/component/upload.md b/docs/component/upload.md
index e70fe2ce7..b7c61d191 100644
--- a/docs/component/upload.md
+++ b/docs/component/upload.md
@@ -655,7 +655,7 @@ const action: string = 'https://mockapi.eolink.com/zhTuw2P8c29bc981a741931bdd86e
| name | 说明 | 最低版本 |
| ------- | ---------------- | -------- |
| default | 上传唤起插槽样式 | - |
-| preview-cover | 自定义覆盖在预览区域上方的内容 | - |
+| preview-cover | 自定义覆盖在预览区域上方的内容 | $LOWEST_VERSION$ |
## Events