Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1092504

Browse files
gimmyhehekagol
authored andcommitted
fix(grid): [grid] fix enter board event do not work (#2788)
1 parent 8a6d9d3 commit 1092504

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/vue/src/grid/src/table/src/events.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,25 +94,25 @@ export function handleEscKeyDown({ event, actived, mouseConfig }) {
9494

9595
export function handleEnterKeyDown({ event, selected, actived }) {
9696
const { highlightCurrentRow, currentRow, treeConfig } = this
97-
let isLeftArrow = event.keyCode === 37
98-
let isUpArrow = event.keyCode === 38
99-
let isRightArrow = event.keyCode === 39
97+
const isLeftArrow = event.keyCode === 37
98+
const isUpArrow = event.keyCode === 38
99+
const isRightArrow = event.keyCode === 39
100100
// 如果是激活状态,退则出到下一行
101101
if (selected.row || actived.row) {
102102
this.moveSelected({
103103
args: selected.row ? selected.args : actived.args,
104104
isLeftArrow,
105105
isUpArrow,
106106
isRightArrow,
107-
isDwArrow: true,
107+
isDownArrow: true,
108108
event
109109
})
110110
} else if (treeConfig && highlightCurrentRow && currentRow) {
111111
// 如果是树形表格当前行回车移动到子节点
112-
let childrens = currentRow[treeConfig.children]
113-
if (childrens && childrens.length) {
112+
const children = currentRow[treeConfig.children]
113+
if (children && children.length) {
114114
event.preventDefault()
115-
let targetRow = childrens[0]
115+
const targetRow = children[0]
116116
this.setTreeExpansion(currentRow, true)
117117
.then(() => this.scrollToRow(targetRow))
118118
.then(() => this.triggerCurrentRowEvent(event, { $table: this, row: targetRow }))

0 commit comments

Comments
 (0)