Skip to content

docs: update uploader doc, add invalid event #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 2, 2020
Merged

Conversation

ddddddddoge
Copy link
Contributor

No description provided.

^^^event-invalid
文件校验失败时触发,回调参数为 `(invalidInfo: Object)`。

+++回调参数字段详情
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
+++回调参数字段详情
+++参数字段详情


| 名称 | 类型 | 描述 |
| -- | -- | -- |
| `file` | `Object` | 没有通过校验的文件信息。如果校验失败的原因是选择的文件数量超过最大数量 `max-count` 限制,则这个字段为空。 |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

加一句“file 参数字段与 remove 事件参数相同”吧

| 名称 | 类型 | 描述 |
| -- | -- | -- |
| `file` | `Object` | 没有通过校验的文件信息。如果校验失败的原因是选择的文件数量超过最大数量 `max-count` 限制,则这个字段为空。 |
| `errors` | `Array` | 包含该文件所有校验错误信息的数组,数组的每一项是包含校验失败信息的对象。 |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `errors` | `Array` | 包含该文件所有校验错误信息的数组,数组的每一项是包含校验失败信息的对象。 |
| `errors` | `Array<Object>` | 包含该文件所有校验错误信息的数组,数组的每一项是包含校验失败信息的对象。 |


| 名称 | 类型 | 描述 |
| -- | -- | -- |
| `type` | `string` | 校验失败的类型,类型可从 `Uploader` 组件 `export` 的 `(errors: Object)` 对象获取,`errors` 对象包含 `TYPE_INVALID`/`SIZE_INVALID`/`TOO_MANY_FILES`/`CUSTOM_INVALID` 这四个字段,分别对应文件类型、文件大小、文件数量、自定义校验失败。 |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是不是应该再搞一个表格,列一下 typevalue 的类型、含义的关系?

@Justineo Justineo merged commit 93c8b00 into master Sep 2, 2020
@Justineo Justineo deleted the uploader branch September 2, 2020 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants