From d69a17db10df4fe31109a3aa1d2a2f9594d9d962 Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期四, 13 十一月 2025 14:54:40 +0800
Subject: [PATCH] BUG
---
pages/index.vue | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/pages/index.vue b/pages/index.vue
index 72fa046..e27ef64 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -580,20 +580,22 @@
return `${year}-${month}-${day}`; // 杩斿洖鏍煎紡鍖栧悗鐨勫瓧绗︿覆
},
selectionChange(e) {
- // 鍙繚鐣欐渶鍚庨�変腑鐨勯偅涓�鏉�
- if (e.detail && e.detail.index !== undefined) {
- this.selectedIndexs = [e.detail.index];
+ // 鍙厑璁搁�変腑涓�鏉�
+ if (Array.isArray(e.detail) && e.detail.length > 0) {
+ // 鍙繚鐣欐渶鍚庝竴鏉�
+ const last = e.detail[e.detail.length - 1];
+ this.selectedIndexs = [this.tableData.indexOf(last)];
- // 鍙栨秷鍏朵粬宸查��
+ // 鍙�変腑鏈�鍚庝竴鏉�
this.$nextTick(() => {
- // 鑾峰彇琛ㄦ牸ref
const table = this.$refs.table;
- if (table && table.clearSelection) {
+ if (table && table.clearSelection && table.toggleRowSelection) {
table.clearSelection();
- // 閲嶆柊閫変腑褰撳墠
- table.toggleRowSelection(this.tableData[e.detail.index], true);
+ table.toggleRowSelection(last, true);
}
});
+ } else {
+ this.selectedIndexs = [];
}
},
--
Gitblit v1.9.3