我正在尝试使用一个名为uppy.io(https://uppy.io/)的图片上传插件。而且它在内部使用了一个图像编辑器插件(https://uppy.io/docs/image-editor/)。因此,我在尝试使用Uppy.ImageEditor时遇到的问题是,它在控制台中返回Expected a plugin class, but got undefined.。你知道为什么会这样吗?下面是我使用的代码。任何帮助都将不胜感激。
var uppy = Uppy.Core()
.use(Uppy.Dashboard, {
inline: true,
target: '#drag-drop-area',
height: 300,
metaFields: [
{ id: 'name', name: 'Name', placeholder: 'file name' },
{ id: 'caption', name: 'Caption', placeholder: 'describe what the image is about' }
]
})
.use(Uppy.Webcam, { target: Uppy.Dashboard })
.use(Uppy.Instagram, { target: Uppy.Dashboard, companionUrl: 'https://companion.uppy.io' })
.use(Uppy.ImageEditor, {
target: Uppy.Dashboard,
id: 'ImageEditor',
quality: 0.8,
cropperOptions: {
viewMode: 1,
background: false,
autoCropArea: 1,
responsive: true
}
})
.use(Uppy.Tus, {endpoint: 'https://master.tus.io/files/'})
uppy.on('complete', (result) => {
console.log('Upload complete! We’ve uploaded these files:', result.successful)
})发布于 2021-10-05 04:10:31
强文本
Uppy还不允许CDN包这样做,但我们可以使用react js实现这一点。
https://stackoverflow.com/questions/63517438
复制相似问题