beforeCrop校验没有通过,但是依旧上传成功,觉得不对,但是,我不能肯定,是不是我用不对? #282
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
代码如下
我起初时没有加,Upload的beforeUpload,然后校验图片的大小,不通过,但是依旧会触发上传接口。
我查看了源码
EasyCrop.tsx
文件beforeCrop校验不通过的时候,依旧使用runBeforeUpload处理了文件。
runBeforeUpload
方法中会判断Upload
的beforeUpload
方法是否存在,然后决定是否resolve文件。起初我是没有传

Upload
的beforeUpload
校验文件的。然后就出现了没有打开裁剪弹窗依旧上传了文件现在是在
Upload
组件添加了beforeUpload
方法可以解决。Beta Was this translation helpful? Give feedback.
All reactions