mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-29 13:34:32 +08:00
加载进度事件
This commit is contained in:
1 parent
754edac71a
commit
6eacff68d3
4 files changed
+45
-34
No files matched your search
@@ -147,7 +147,12 @@ export class Resource<
|
||||
) {
|
||||
this.emit('loadstart');
|
||||
this.request = axios
|
||||
.get(data, { responseType: this.format })
|
||||
.get(data, {
|
||||
responseType: this.format,
|
||||
onDownloadProgress: e => {
|
||||
this.emit('progress', e);
|
||||
}
|
||||
})
|
||||
.then(v => {
|
||||
this.resource = v.data;
|
||||
this.loaded = true;
|
||||
@@ -157,7 +162,12 @@ export class Resource<
|
||||
} else if (this.format === 'zip') {
|
||||
this.emit('loadstart');
|
||||
this.request = axios
|
||||
.get(data, { responseType: 'arraybuffer' })
|
||||
.get(data, {
|
||||
responseType: 'arraybuffer',
|
||||
onDownloadProgress: e => {
|
||||
this.emit('progress', e);
|
||||
}
|
||||
})
|
||||
.then(v => {
|
||||
this.resource = new ZippedResource(v.data);
|
||||
this.loaded = true;
|
||||
|
||||
Reference in new issue
Block a user