From f8f57eac8906eabf2202244dc1a8aae1b531fef1 Mon Sep 17 00:00:00 2001 From: xzg <4727863@qq.com> Date: Wed, 23 Oct 2024 22:14:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E8=87=AA=E5=8A=A8=E5=8B=BE?= =?UTF-8?q?=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Tableexportcomponent/Tableexportcomponent.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Tableexportcomponent/Tableexportcomponent.vue b/src/components/Tableexportcomponent/Tableexportcomponent.vue index 6fbee0b1..9eaf7fc2 100644 --- a/src/components/Tableexportcomponent/Tableexportcomponent.vue +++ b/src/components/Tableexportcomponent/Tableexportcomponent.vue @@ -56,6 +56,9 @@ removeColumn('复选框'); const exportFileName = ref(''); // 已选择的列 const checkedColumns = ref([]); +const initializeCheckedColumns = () => { + checkedColumns.value = transferData.value.map(item => item.key); +}; // 构建 el-transfer 所需的数据格式,并添加类型检查 const transferData = computed(() => { @@ -69,7 +72,7 @@ const transferData = computed(() => { return []; } }); - +initializeCheckedColumns(); // 设置 el-transfer 的 props const transferProps = { key: 'key',