Skip to content

<a-upload> file-list parameter type declaration problem #5047

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

Closed
1 task
ll60 opened this issue Dec 16, 2021 · 1 comment
Closed
1 task

<a-upload> file-list parameter type declaration problem #5047

ll60 opened this issue Dec 16, 2021 · 1 comment
Labels

Comments

@ll60
Copy link

ll60 commented Dec 16, 2021

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.0.0-alpha.15

Environment

操作系统: macOS12.0.1、浏览器: Chrome 版本 96.0.4664.55(正式版本) (arm64)、VUE版本: 3.2.16

Reproduction link

Edit on CodeSandbox

Steps to reproduce

点击的参数file-list可跳转到声明位置,如下:

fileList?: { uid: any; name: any; }[];

而官网实例是:

interface FileItem { uid: string; name?: string; status?: string; response?: Response; url: string; }

在编辑器中,会报错:不能将类型FileItem类型分配给类型“{ uid: any; name: any; }”。ts(2322)
fileList有name, 而FileItem的name不是必需的,实际上却是name不用必需,是否需要改下fileList的声明,还是说我们在使用时需要声明name是必需的

What is expected?

期望得到正确的类型声明

What is actually happening?

出现了额外的非必需的name属性。

@github-actions github-actions bot changed the title <a-upload>的file-list参数类型声明问题 <a-upload> file-list parameter type declaration problem Dec 16, 2021
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant