ant-design-vue在ios使用AUpload组件唤起了相机,HTML的 `capture` 属性

在使用ant design vue组件的上传组件AUpload的时候有一个问题,直接按照demo写,在ios上会唤起相机,但是实际上我们的需求是弹出选择相册/相机这个弹框。

解决办法是加一个 cupture="null"这个属性即可

html 复制代码
<a-upload
	:capture="null"
	accept=".png,.jpg,jpeg"
	@change="handleImgChange"
>
	点击上传
</a-upload>

HTML attribute: capture - HTML: HyperText Markup Language | MDNThe capture attribute specifies that, optionally, a new file should be captured, and which device should be used to capture that new media of a type defined by the accept attribute.https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/capture

相关推荐
777VG7 小时前
PostgreSQL +martin将多张表输出成一个 MVT
前端·数据库·postgresql
mayaairi7 小时前
JS循环语句深度解析:嵌套for、while与do...while
开发语言·前端·javascript
To_OC7 小时前
啃完流式输出:从一个卡顿的 LLM 接口开始,我搞懂了数据流到底怎么 “流”
前端·javascript·llm
阳光是sunny8 小时前
LangGraph实战教程:defer延迟节点——让收尾工作自动排到最后
前端·人工智能·后端
kyriewen8 小时前
我用了三周Claude Code Skills——总结出5条铁律,第3条最反直觉
前端·ai编程·claude
阳光是sunny8 小时前
LangGraph实战教程:控制流详解
前端·人工智能·后端
格尔曼Noah9 小时前
Safari浏览器中如何只允许指定网站下载
前端·safari
用户0595401744610 小时前
用了3年Redis,才发现我一直没搞懂缓存一致性测试
前端·css
swipe10 小时前
07|(前端转后全栈)为什么后端也要缓存?从前端缓存思维理解 Redis
前端·后端·全栈
IT小盘10 小时前
05-企业项目统一接入多个大模型-适配器模式实战
前端·人工智能·适配器模式