-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
手机端无法限制图片类型,上传后也没有返回错误消息 #219
Comments
这两天做项目用这组件也遇到了这个问题,我通过修改源码的方式解决了 1、首先把组件源码下载下来,放到自己项目的组件目录里(要用源码里src目录下的所有文件,不要用dist目录下的文件); 2、打开vue-core-image-upload.vue文件,修改change(e)方法如下:
我的做法其实就是获取不到扩展名的时候,不报错跳出,让代码继续执行下去,上传那块就不压缩图片了,使用base64上传。 另外,上传后台,如果是通过文件名获取扩展名,也是获取不到的,建议使用文件的MIME/Type来补上扩展名。 3、修改引用的地方为: import VueCoreImageUpload from "@components/VueCoreImageUpload/vue-core-image-upload"; 项目要求不高,我就没有继续优化了,以上代码还有继续优化的空间,欢迎拍砖~~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: