Skip to content

Commit a94b814

Browse files
committed
fix: 修复setRow会导致keyField类型变更的问题,number类型的key会变为string类型
1 parent 5d3d0c8 commit a94b814

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/table/src/util.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@ export function getRowkey ($xeTable: VxeTableConstructor) {
109109
// 行主键 value
110110
export function getRowid ($xeTable: VxeTableConstructor, row: any) {
111111
const rowid = XEUtils.get(row, getRowkey($xeTable))
112-
return XEUtils.eqNull(rowid) ? '' : encodeURIComponent(rowid)
112+
if (XEUtils.eqNull(rowid)) {
113+
return ''
114+
}
115+
const type = typeof rowid
116+
return (type === 'number' || type === 'bigint') ? rowid : encodeURIComponent(rowid)
113117
}
114118

115119
export interface XEColumnInstance {

0 commit comments

Comments
 (0)