Skip to content

Commit

Permalink
fix: 修复setRow会导致keyField类型变更的问题,number类型的key会变为string类型
Browse files Browse the repository at this point in the history
  • Loading branch information
ming4762 committed Feb 21, 2025
1 parent 5d3d0c8 commit a94b814
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/table/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ export function getRowkey ($xeTable: VxeTableConstructor) {
// 行主键 value
export function getRowid ($xeTable: VxeTableConstructor, row: any) {
const rowid = XEUtils.get(row, getRowkey($xeTable))
return XEUtils.eqNull(rowid) ? '' : encodeURIComponent(rowid)
if (XEUtils.eqNull(rowid)) {
return ''
}
const type = typeof rowid
return (type === 'number' || type === 'bigint') ? rowid : encodeURIComponent(rowid)
}

export interface XEColumnInstance {
Expand Down

0 comments on commit a94b814

Please sign in to comment.