We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
与Upload组件封装结合时,传入的初始值往往是string或string[],此时需要转换为UploadFile[],而输出时需要从UploadFile[]转换为string或string[]。 而现有的normalize等方法似乎难以实现,因为UploadFile中也包含了文件的当前状态(上传中、上传失败等)等信息,由多转少(UploadFile转string)容易,而由少转多难(string转UploadFile) 若每次都在onFinish方法中处理请求会产生很多冗余代码。 希望可以给出解决方案或建议~
Upload
string
string[]
UploadFile[]
normalize
UploadFile
onFinish
formatter方法在传入初始值时,转为指定类型。 parser方法在Form表单提交时,转为指定类型。
formatter
parser
The text was updated successfully, but these errors were encountered:
已阅读 #19727 等 issue~ 感觉没有这两个属性还是很难搞的~
Sorry, something went wrong.
建议自行封装一个高阶组件,这个在 Form.Item 上加属性会更复杂。
目前是的,忽略了value的更新,把fileList的处理都在内部消化了
value
fileList
No branches or pull requests
What problem does this feature solve?
与
Upload
组件封装结合时,传入的初始值往往是string
或string[]
,此时需要转换为UploadFile[]
,而输出时需要从UploadFile[]
转换为string
或string[]
。而现有的
normalize
等方法似乎难以实现,因为UploadFile
中也包含了文件的当前状态(上传中、上传失败等)等信息,由多转少(UploadFile转string)容易,而由少转多难(string转UploadFile)若每次都在
onFinish
方法中处理请求会产生很多冗余代码。希望可以给出解决方案或建议~
What does the proposed API look like?
formatter
方法在传入初始值时,转为指定类型。parser
方法在Form表单提交时,转为指定类型。The text was updated successfully, but these errors were encountered: