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

解决办法是加一个 cupture="null"这个属性即可
- <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
来源:https://blog.csdn.net/qq_17335549/article/details/132319736
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作! |