【发布时间】:2020-09-29 18:03:29
【问题描述】:
使用 filepond 我需要自定义 filepond droparea,这意味着我需要添加一些带有一些占位符图像的自定义 HTML,以便让用户了解应该上传什么样的图像并允许多次上传。
有没有办法做到这一点?
我尝试使用占位符添加一个绝对定位的容器,但我无法在上传我的自定义元素时覆盖。
这是我在 react 中使用 Filepond 的方式:
...
return (
<div className="uploads">
<div className="uploads__placeholders">{placeholderImages}</div>
<FilePond
ref={(ref) => (this.pond = ref)}
files={this.state.files}
labelIdle={""}
allowMultiple={true}
maxTotalFileSize={10485760}
acceptedFileTypes={this.props.acceptedFileTypes}
labelMaxTotalFileSize={"Total file size should be lesser than 10MB."}
maxFiles={maxFilesAllowed}
allowProcess={this.props.process ? this.props.process : true}
imagePreviewHeight={135}
//imagePreviewTransparencyIndicator={"grid"}
server={{...}}
onremovefile={(file) => {...}}
oninit={(t) => {...}}
onupdatefiles={(fileItems) => {...}}
/>
</div>
);
...
所以我创建了一个自定义包装器,并在 filepond 包装器之上与 css 对齐,但这似乎不是理想的解决方法。
【问题讨论】:
-
您需要先在这里给我们一些可以使用的东西 - minimal reproducible example 显示您的问题,理想情况下也是您已经尝试过的问题。
标签: javascript html css filepond