Skip to content

Commit

Permalink
fix(components): [table-v2] the selector is invalid when row-key is…
Browse files Browse the repository at this point in the history
… a number (element-plus#16989)

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

* fix: use String() replace to `as string` element-plus#16989
  • Loading branch information
Whbbit1999 authored Jun 11, 2024
1 parent 8bd642f commit 7648011
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/components/table-v2/src/composables/use-row.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down

0 comments on commit 7648011

Please sign in to comment.