每当我尝试在同一网页上创建多个Filepond输入时,只有第一个输入具有样式,并且可以作为FilePond网站上的示例完美地工作,而其他输入则不起作用。请尽我所能,但仍然没有得到帮助,请提供帮助。 我的意思是ScreenShot
看起来屏幕快照中的字段尚未初始化,您需要定位要转换为FilePond实例的每个字段。
有关单个实例,请参见此处的示例代码。 https://pqina.nl/filepond/docs/patterns/api/filepond-object/#creating-a-filepond-instance
对于多个实例,它应该类似于:
<input type="file" class="filepond">
<input type="file" class="filepond">
<input type="file" class="filepond">
<script>
// get a collection of elements with class filepond
const inputElements = document.querySelectorAll('input.filepond');
// loop over input elements
Array.from(inputElements).forEach(inputElement => {
// create a FilePond instance at the input element location
FilePond.create(inputElement);
})
</script>
非常感谢您的反馈。现在工作正常
太好了,太完美了。我在filepond文档中的任何地方都找不到。
您的代码可以使所有Filepond实例正确显示。但是我后来遇到了一个错误:对于除最后一个实例之外的所有实例,文件上传均无效。它仅上载到“ tmp”文件夹,而提交后不上载“ uploads”文件夹。看来php服务器只考虑实例了...