1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
| <template>
| <el-button
| icon="Download"
| type="primary"
| plain
| @click="download"
| :loading="dlLoading"
| >{{ label }}</el-button
| >
| </template>
| <script setup>
| import { ref } from 'vue';
| import { conversionFromTable } from '@/utils/excel';
|
| const props = defineProps({
| // 下载文件名称
| fileName: String,
| // 表格元素id
| tableId: String,
| label: {
| type: String,
| default: '下载'
| }
| });
|
| const dlLoading = ref(false);
|
| function download() {
| dlLoading.value = true;
| conversionFromTable(props.tableId, props.fileName);
| dlLoading.value = false;
| }
| </script>
|
|