本文介绍了如何在 React 的 Material UI 简单输入上启用文件上传?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在创建一个简单的表单来使用电子反应样板和 redux 表单上传文件材质界面.
I am creating a simple form to upload file using electron-react-boilerplate with redux form & material ui.
问题是我不知道如何创建输入文件字段,因为材料ui不支持上传文件输入.
The problem is that I do not know how to create input file field because material ui does not support upload file input.
关于如何实现这一目标的任何想法?
Any ideas on how to achieve this?
推荐答案
API 提供了用于此目的的 component
.
The API provides component
for this purpose.
<Button
variant="contained"
component="label"
>
Upload File
<input
type="file"
hidden
/>
</Button>
这篇关于如何在 React 的 Material UI 简单输入上启用文件上传?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!