Skip to content
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

示例中uploader图片手动上传的问题 #355

Open
KKMrTan opened this issue Jan 10, 2022 · 1 comment
Open

示例中uploader图片手动上传的问题 #355

KKMrTan opened this issue Jan 10, 2022 · 1 comment

Comments

@KKMrTan
Copy link

KKMrTan commented Jan 10, 2022

https://weui.io/weui.js/示例的“上传” =》 “图片手动上传”中,在已有图片的情况下,再去选择图片,会覆盖掉原有的图片,发现是
var _id = 0; // 该id覆盖
function uploader(selector, options) {
····
if (options.compress === false && options.type == 'file') {
// 以原文件方式上传
Array.prototype.forEach.call(files, function (file) {
file.id = ++_id;

                if (options.onBeforeQueued(file, files) === false) return;

                setUploadFile(file);
            });
        } else {
            // base64上传 和 压缩上传
            Array.prototype.forEach.call(files, function (file) {
                file.id = ++_id;

                if (options.onBeforeQueued(file, files) === false) return;

                (0, _image.compress)(file, options, function (blob) {
                    if (blob) setUploadFile(blob);
                });
            });
        }

····

@BearJ
Copy link
Collaborator

BearJ commented Jan 10, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants