mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-09-10 23:09:44 +08:00
uploader
This commit is contained in:
parent
7d5b336fac
commit
c1e1abd158
@ -38,6 +38,7 @@
|
|||||||
if (this.beforeRead && ! this.beforeRead(file)) return;
|
if (this.beforeRead && ! this.beforeRead(file)) return;
|
||||||
|
|
||||||
var reader = new FileReader();
|
var reader = new FileReader();
|
||||||
|
|
||||||
reader.onload = (e) => {
|
reader.onload = (e) => {
|
||||||
this.$emit('file-readed',
|
this.$emit('file-readed',
|
||||||
{
|
{
|
||||||
@ -48,11 +49,13 @@
|
|||||||
});
|
});
|
||||||
this.$refs.input.value = '';
|
this.$refs.input.value = '';
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.resultType == 'dataUrl') {
|
if (this.resultType == 'dataUrl') {
|
||||||
reader.readAsDataURL(file);
|
reader.readAsDataURL(file);
|
||||||
} else if (this.resultType == 'text') {
|
} else if (this.resultType == 'text') {
|
||||||
reader.readAsText(file);
|
reader.readAsText(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user