diff --git a/packages/uploader/README.md b/packages/uploader/README.md index 0044d1b6..760086d3 100644 --- a/packages/uploader/README.md +++ b/packages/uploader/README.md @@ -248,6 +248,7 @@ uploadFilePromise(fileName, chooseResult) { | extension `v1.10.11` | 当 accept 为 `file` 时生效,根据文件拓展名过滤可选择文件。每一项都不能是空字符串。默认不过滤 | _string[] \| undefined_ | - | | showmenu `v1.10.13` | 预览图片时,是否显示长按菜单 | _boolean_ | `true` | | upload-icon | 上传区域图标,可选值见 [Icon 组件](#/icon) | _string_ | `plus` | +| referrer-policy `v1.11.6` | 当 accept 为 video 时生效,具体用法参考 [微信官方 - 媒体组件 / video](https://developers.weixin.qq.com/miniprogram/dev/component/video.html) | string | `no-referrer` | #### accept 的合法值 diff --git a/packages/uploader/index.ts b/packages/uploader/index.ts index 0fb91ed2..7ce4cf97 100644 --- a/packages/uploader/index.ts +++ b/packages/uploader/index.ts @@ -1,7 +1,7 @@ import { VantComponent } from '../common/component'; -import { isImageFile, chooseFile, isVideoFile, File } from './utils'; -import { imageProps, videoProps, mediaProps, messageFileProps } from './shared'; import { isBoolean, isPromise } from '../common/validator'; +import { imageProps, mediaProps, messageFileProps, videoProps } from './shared'; +import { chooseFile, File, isImageFile, isVideoFile } from './utils'; VantComponent({ props: { diff --git a/packages/uploader/index.wxml b/packages/uploader/index.wxml index 3e61fd9f..2276fbf4 100644 --- a/packages/uploader/index.wxml +++ b/packages/uploader/index.wxml @@ -29,6 +29,7 @@ poster="{{ item.thumb }}" autoplay="{{ item.autoplay }}" object-fit="{{videoFit}}" + referrer-policy="{{videoReferrerPolicy}}" class="van-uploader__preview-image" style="{{ computed.sizeStyle({ previewSize }) }}" data-index="{{ index }}" diff --git a/packages/uploader/shared.ts b/packages/uploader/shared.ts index 755630b0..defe4815 100644 --- a/packages/uploader/shared.ts +++ b/packages/uploader/shared.ts @@ -32,6 +32,10 @@ export const videoProps = { type: String, value: 'back', }, + referrerPolicy: { + type: String, + value: 'no-referrer', + }, }; // props for media