【发布时间】:2020-07-27 10:30:23
【问题描述】:
【问题讨论】:
【问题讨论】:
只需将更多 <input's /> 作为孩子传递给 Dropzone,例如:
<Dropzone
onDrop={(onDropProps) =>
console.log("onDropProps in onDrop event handler", onDropProps)
}
accept='image/jpg,image/jpeg,image/png'
multiple={true}
>
{({ getRootProps, getInputProps, isDragActive }) => {
console.log("getRootProps", getRootProps());
console.log("getInputProps", getInputProps());
console.log("isDragActive", isDragActive);
return (
<div>
<div {...getRootProps()}>
<input {...getInputProps()} />
{<p className='fileDrop'>Try dropping one or more files here</p>}
</div>
<div {...getRootProps()}>
<input {...getInputProps()} />
{<p className='fileDrop'>Try dropping one or more files here</p>}
</div>
<div {...getRootProps()}>
<input {...getInputProps()} />
{<p className='fileDrop'>Try dropping one or more files here</p>}
</div>
</div>
);
}}
</Dropzone>
我在可折叠的桌子上使用 Dropzone,所以当我折叠一行时,我可以访问所有三个道具,例如
【讨论】: