Skip to content

Commit

Permalink
feat: Batch download
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanzhi33 committed Jul 20, 2024
1 parent 457aa0e commit 990e52c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion docs/data.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ <h1 class="text-center">

</div>
<div class="float-right">
<a href="#" @click.prevent="batchDownload">
<i class="fa fa-download"></i>
</a> &nbsp;
Page
<select v-model="page">
<option v-for="i in totalPage">{{ i }}</option>
Expand Down Expand Up @@ -163,7 +166,7 @@ <h1 class="text-center">
history.replaceState(null, "", location.href.split("?")[0]);
}
</script>
<script src="https://www.xuanzhi33.cn/js/global.v2.js" data-sendinfo="no"></script>
<script src="https://www.xuanzhi33.cn/js/global.v2.js"></script>
<script src="https://unpkg.zhimg.com/vue@3/dist/vue.global.prod.js"></script>
<script type="module">
const { createApp } = Vue;
Expand Down Expand Up @@ -283,6 +286,11 @@ <h1 class="text-center">
a.href = url;
a.download = `${fileName}.csv`;
a.click();
},
async batchDownload() {
for (const item of this.data) {
await this.makeCSV(item.data, item.user);
}
}
},
template: "#main"
Expand Down

0 comments on commit 990e52c

Please sign in to comment.