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

[Feature Request] Uploader手动填充数据时仅有base64也可以预览 #12913

Closed
jackjtr opened this issue Jun 5, 2024 · 3 comments
Closed

Comments

@jackjtr
Copy link

jackjtr commented Jun 5, 2024

这个功能解决了什么问题?

在给Uploader组件的v-model手动填充仅包含content字段的对象时,缩略图可以显示但是点击无法预览,需要额外将base64数据转换成file和blobUrl并加入数据才可以正常预览
主要用于只读不可编辑但可预览

你期望的 API 是什么样子的?

<van-uploader v-model="fileList" />
const fileList = ref([
  { content: `data:image/png;base64/...` },
]);
@day-xue
Copy link

day-xue commented Jun 14, 2024

你把base64 赋值给url 并且 isImage 为true就行

@inottn
Copy link
Collaborator

inottn commented Jul 18, 2024

@inottn inottn closed this as completed Jul 18, 2024
@jackjtr
Copy link
Author

jackjtr commented Jul 25, 2024

参考 https://vant-ui.github.io/vant/#/zh-CN/uploader#wen-jian-yu-lan

要不更新一下文档吧,列一下url支持哪些类型,反正我看文档是看不出支持base64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants