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

Open
jackjtr opened this issue Jun 5, 2024 · 1 comment
Open

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就行

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

2 participants