fix: Optimize the trigger method for table selection (#10268)

Refs #10262
This commit is contained in:
ssongliu 2025-09-04 18:23:32 +08:00 committed by GitHub
parent cc6b506176
commit bcfc78e510
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View file

@ -195,8 +195,14 @@ watch(
{ immediate: true },
);
function handleRowClick(row: any, column: any, event: MouseEvent) {
function handleRowClick(row: any, column: any, event: any) {
if (!tableRef.value) return;
try {
const selectionColumn = tableRef.value.refElTable.columns.find((col) => col.type === 'selection');
const isSelectable = selectionColumn.selectable(row);
if (!isSelectable) return;
} catch {}
const target = event.target as HTMLElement;
if (target.closest('.el-checkbox')) return;

View file

@ -63,7 +63,7 @@
<template #default="{ row }">
<div v-for="(item, index) in row.labels" :key="index">
<div v-if="row.expand || (!row.expand && index < 3)">
<el-tag type="info">{{ item }}</el-tag>
<el-button class="mt-0.5" plain size="small">{{ item }}</el-button>
</div>
</div>
<div v-if="!row.expand && row.labels.length > 3">