fix(components): [table-v2] the selector is invalid when row-key is a number (#16989)

* fix: rowKey use number or start of number onRowHovered Throw Error#16988

* fix: use String() replace to `as string` #16989
This commit is contained in:
Whbbit1999 2024-06-11 21:44:19 +08:00 committed by GitHub
parent 8bd642f567
commit 7648011303
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -64,7 +64,7 @@ export const useRow = (
return
}
const tableRoot = tableInstance!.vnode.el as HTMLElement
const rows = tableRoot.querySelectorAll(`[rowkey=${rowKey as string}]`)
const rows = tableRoot.querySelectorAll(`[rowkey="${String(rowKey)}"]`)
rows.forEach((row) => {
if (hovered) {
row.classList.add(ns.is('hovered'))