Skip to content
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

[Upload] Upload 怎么回显? #2187

Closed
NiLinli opened this issue Apr 28, 2023 · 3 comments
Closed

[Upload] Upload 怎么回显? #2187

NiLinli opened this issue Apr 28, 2023 · 3 comments
Assignees
Labels
example Something about example

Comments

@NiLinli
Copy link

NiLinli commented Apr 28, 2023

这个功能解决了什么问题

  1. 新增时候上传图片
  2. 编辑时候获取 url 回显示图片

你建议的方案是什么?

文档没有告知回显方法,尝试通过 url 构造 fake UploadFile 值,然后 form.setFieldsValue ,也没有效果

@github-actions
Copy link
Contributor

👋 @NiLinli,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@github-actions
Copy link
Contributor

github-actions bot commented Apr 28, 2023

♥️ 有劳 @wookaoer @teal-front @carolin913 @chaishi 尽快确认问题。
确认有效后将下一步计划和可能需要的时间回复给 @NiLinli

@HaixingOoO HaixingOoO added the example Something about example label Oct 16, 2023
@chaishi
Copy link
Collaborator

chaishi commented Nov 5, 2023

传入 files 属性可以自动回显

image image
const [files2, setFiles2] = useState([
  {
    url: 'https://tdesign.gtimg.com/demo/demo-image-1.png',
    name: 'default.jpeg',
    status: 'success',
  },
]);

<Upload files={files} />

@chaishi chaishi closed this as completed Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
example Something about example
Projects
None yet
Development

No branches or pull requests

4 participants