|
82 | 82 | | ``controls`` | `function(Object, Array<Object>): Array<Object>` | - | [^controls] |
|
83 | 83 | | ``multiple`` | `boolean` | `false` | 上传多个文件,当 `max-count` 是 `1`,`multiple` 是 `true`,那么 `value` 也是数组。 |
|
84 | 84 | | ``entries`` | `function(Array<Object>): Array<Object>` | - | [^entries] |
|
| 85 | +| ``pick`` | `function(number): Promise<Object>` | - | [^pick] | |
85 | 86 | | ``after-pick`` | `function(Array<Object>): void` | - | 选择文件之后的回调。 |
|
86 | 87 | | ``sortable`` | `boolean` | `false` | 文件列表是否可以排序。 |
|
87 | 88 | | ``preview-options`` | `object` | `{wrap: true, indicator: 'number'}` | 传递给 [`Lightbox`](./lightbox) 的预览选项。 |
|
| 89 | +| ``preview-options`` | `object` | `{wrap: true, indicator: 'number'}` | 传递给 [`Lightbox`](./lightbox) 的预览选项。 | |
| 90 | +| ``validity-display`` | `'popup' | 'inline'` | `'popup'` | [^validity-display] | |
| 91 | +| ``help`` | `string` | - | 帮助文本。 | |
| 92 | +| ``help-position`` | `'side' | 'bottom'` | `'side'` | [^help-position] | |
| 93 | +| ``picker-label`` | `string` | - | 上传按钮的文本。 | |
| 94 | +| ``picker-icon`` | `string | Object` | - | 上传按钮的图标,参考 [`Icon`](./icon) 的 [`name`](./icon#props-name) 属性。 | |
88 | 95 |
|
89 | 96 |
|
90 | 97 | ^^^ui
|
|
185 | 192 | | -- | -- |
|
186 | 193 | | `before` | 上传按钮始终在队列最前面。 |
|
187 | 194 | | `after` | 上传按钮始终在队列最后面。 |
|
| 195 | +| `top` | 上传按钮始终在队列上面。 | |
| 196 | +| `none` | 不展示上传按钮。 | |
| 197 | ++++ |
| 198 | +^^^ |
| 199 | + |
| 200 | +^^^pick |
| 201 | +自定义选择文件逻辑, 返回的文件会被上传。 |
| 202 | + |
| 203 | +```ts |
| 204 | +function picker() : Promise<PickedFile | PickedFile[]> |
| 205 | + |
| 206 | +type PickedFile = { |
| 207 | + name: string |
| 208 | + type: string |
| 209 | + src: string |
| 210 | + poster?: string |
| 211 | + alt?: string |
| 212 | + size?: number |
| 213 | +} |
| 214 | +``` |
| 215 | ++++枚举值 |
| 216 | +| 值 | 描述 | |
| 217 | +| -- | -- | |
| 218 | +| `name` | 文件名称。 | |
| 219 | +| `type` | 文件类型。 | |
| 220 | +| `src` | 文件地址。 | |
| 221 | +| `poster` | 视频文件的预览图片。 | |
| 222 | +| `alt` | 替换文本。 | |
| 223 | +| `size` | 文件大小。 | |
188 | 224 | +++
|
189 | 225 | ^^^
|
190 | 226 |
|
| 227 | +^^^validity-display |
| 228 | +校验信息的展示方式。 |
| 229 | +
|
| 230 | ++++枚举值 |
| 231 | +| 值 | 描述 | |
| 232 | +| -- | -- | |
| 233 | +| `popup` | 悬浮时浮层展示校验信息。 | |
| 234 | +| `inline` | 内联显示校验信息。 | |
| 235 | ++++ |
| 236 | +^^^ |
| 237 | +
|
| 238 | +^^^help-position |
| 239 | +帮助信息的展示位置。 |
| 240 | +
|
| 241 | ++++枚举值 |
| 242 | +| 值 | 描述 | |
| 243 | +| -- | -- | |
| 244 | +| `side` | 展示在上传按钮的右边。 | |
| 245 | +| `bottom` | 展示在上传按钮的下面。 | |
| 246 | ++++ |
| 247 | +^^^ |
| 248 | +
|
| 249 | +
|
191 | 250 | ^^^validator
|
192 | 251 | 自定义校验逻辑,参数为原生 [`File`](https://developer.mozilla.org/zh-CN/docs/Web/API/File) 对象。返回结果的格式要求如下:
|
193 | 252 |
|
|
235 | 294 |
|
236 | 295 | | 名称 | 描述 |
|
237 | 296 | | -- | -- |
|
238 |
| -| ``button-label`` | [^button-label] | |
239 | 297 | | ``upload`` | 图片上传模式下,上传按钮的区域。 |
|
240 |
| -| ``desc`` | 对文件数量、格式、大小等的提示内容。 | |
| 298 | +| ``help`` | 对文件数量、格式、大小等的提示内容。 | |
241 | 299 | | ``file`` | [^file] |
|
242 | 300 | | ``file-before`` | 单个文件内容之前的区域。作用域参数与 [`file`](#slots-file) 插槽相同。 |
|
243 | 301 | | ``file-after`` | 单个文件内容之后的区域。作用域参数与 [`file`](#slots-file) 插槽相同。 |
|
244 | 302 | | ``uploading`` | 图片上传模式下,上传中的单个图片的区域。作用域参数与 [`file`](#slots-file) 插槽相同。 |
|
245 | 303 | | ``failure`` | 图片上传模式下,上传失败的单个图片的区域。作用域参数与 [`file`](#slots-file) 插槽相同。 |
|
246 | 304 |
|
247 |
| -^^^button-label |
248 |
| -上传按钮里的内容。 |
249 |
| - |
250 |
| -默认内容:文件上传为提示选择文件,图片上传则为上传图片图标。 |
251 |
| -^^^ |
252 |
| - |
253 | 305 | ^^^file
|
254 | 306 | 单个文件的区域,用来定制文件内容。
|
255 | 307 |
|
|
0 commit comments