Skip to content

upload 在beforeUpload中做完图片压缩再上传, 报 Invalid prop: custom validator check failed for prop "items" #3950

@ZmjDns

Description

@ZmjDns

33333333

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

1.7.2

Environment

wind10,chrome79, vue^2.6.10

Reproduction link

https://github.com/ZmjDns/dnpicture.git

Steps to reproduce

import { compressAccurately } from 'image-conversion' //.... beforeUpload (file) { let isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png' if (!isJpgOrPng) { return new Promise((resolve, reject) => { console.log('此文件类型不允许上传!...............') reject(false) }) } let isLt2M = file.size / 1024 / 1024 < 2 if (!isLt2M) { return compressAccurately(file, {size: 500}) .then((res) => { return new Promise((resolve, reject) => { console.log('压缩成功上传...............', res) resolve(res) }); }) .catch((err) => { console.log("压缩失败", err); return new Promise((resolve, reject) => { resolve(file); }); }); } else { return new Promise((resolve, reject) => { console.log('未压缩上传...............', file) resolve(file) }) } }
在压缩完成之后,浏览器就报了这个错Invalid prop: custom validator check failed for prop "items".

What is expected?

压缩完成之后正常上传文件,并在组件中显示图片

What is actually happening?

运行上面的代码之后,浏览器就报错,并且不能正常显示已上传的图片

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions