|
|
|
@ -46,6 +46,14 @@ export function useCustomRow( |
|
|
|
|
|
|
|
const isCheckbox = rowSelection.type === 'checkbox'; |
|
|
|
if (isCheckbox) { |
|
|
|
// 找到tr
|
|
|
|
const tr: HTMLElement = (e as MouseEvent) |
|
|
|
.composedPath?.() |
|
|
|
.find((dom: HTMLElement) => dom.tagName === 'TR') as HTMLElement; |
|
|
|
if (!tr) return; |
|
|
|
// 找到Checkbox,检查是否为disabled
|
|
|
|
const checkBox = tr.querySelector('input[type=checkbox]'); |
|
|
|
if (!checkBox || checkBox.hasAttribute('disabled')) return; |
|
|
|
if (!keys.includes(key)) { |
|
|
|
setSelectedRowKeys([...keys, key]); |
|
|
|
return; |
|
|
|
|