diff --git a/docs/component/upload.md b/docs/component/upload.md index e7b884e9b..b7c61d191 100644 --- a/docs/component/upload.md +++ b/docs/component/upload.md @@ -567,6 +567,31 @@ const customUpload: UploadMethod = (file, formData, options) => { } ``` + +## 自定义预览样式 + +使用 `preview-cover` 插槽可以自定义覆盖在预览区域上方的内容 + +```html + + + + +``` + +```typescript +const fileList = ref([]) +const action: string = 'https://mockapi.eolink.com/zhTuw2P8c29bc981a741931bdd86eb04dc1e8fd64865cb5/upload' +``` + ## Attributes | 参数 | 说明 | 类型 | 可选值 | 默认值 | 最低版本 | @@ -630,6 +655,7 @@ const customUpload: UploadMethod = (file, formData, options) => { | name | 说明 | 最低版本 | | ------- | ---------------- | -------- | | default | 上传唤起插槽样式 | - | +| preview-cover | 自定义覆盖在预览区域上方的内容 | $LOWEST_VERSION$ | ## Events diff --git a/src/pages/upload/Index.vue b/src/pages/upload/Index.vue index 0245a5863..ba2463fdd 100644 --- a/src/pages/upload/Index.vue +++ b/src/pages/upload/Index.vue @@ -73,6 +73,15 @@ + + + + + + - + 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 0b1a88f1f..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 @@ -64,6 +64,8 @@ custom-class="wd-upload__close" @click="removeFile(index)" > + +