我正在使用 Uppy Dashboard,每当状态更改时,uppy 都会重置其状态并且不显示上传的图像。如何在我的 uppy 中添加/显示图像?如何在 uppy.io 库中预填充/预加载图像?
任何帮助将不胜感激。谢谢下面是我的代码:
const equipment_uppy = new Uppy({
id: 'equipment_uppy',
restrictions: { allowedFileTypes: ['image/*', 'video/*'] },
autoProceed: false
})
equipment_uppy.on('file-added', (file) => {
equipment_uppy.setFileMeta(file.id, {
type: file.source,
avintakeid : data.id
})
})
equipment_uppy.use(XHRUpload, {
endpoint: `${process.env.REACT_APP_SITE_URL}/api/auth/uploadavintakeimages`,
formData: true,
fieldName: 'files[]',
headers: {
Authorization: `Bearer ${localStorage.getItem('accessToken')}`
}})
equipment_uppy.use(Webcam)
<Dashboard
uppy={equipment_uppy}
id='equipment_location_image'
width='100%'
height='300px'
plugins={['Webcam']}
/>