Skip to content

Commit e3b24a2

Browse files
committed
Update index.jsx
1 parent 57c017c commit e3b24a2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/ve-table/src/index.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1742,27 +1742,27 @@ export default {
17421742
const { callback } = contextmenuBodyOption;
17431743

17441744
if (!isEmptyValue(rowKey) && !isEmptyValue(colKey)) {
1745-
const tableIndex = allRowKeys.findIndex((x) => x === rowKey);
1745+
const rowIndex = allRowKeys.findIndex((x) => x === rowKey);
17461746

17471747
// insert row above
17481748
if (CONTEXTMENU_TYPES.INSERT_ROW_ABOVE === type) {
17491749
tableData.splice(
1750-
tableIndex,
1750+
rowIndex,
17511751
0,
17521752
createEmptyRowData({ colgroups, rowKeyFieldName }),
17531753
);
17541754
}
17551755
// insert row below
17561756
else if (CONTEXTMENU_TYPES.INSERT_ROW_BELOW === type) {
17571757
tableData.splice(
1758-
tableIndex + 1,
1758+
rowIndex + 1,
17591759
0,
17601760
createEmptyRowData({ colgroups, rowKeyFieldName }),
17611761
);
17621762
}
17631763
// remove row
17641764
else if (CONTEXTMENU_TYPES.REMOVE_ROW === type) {
1765-
tableData.splice(tableIndex, 1);
1765+
tableData.splice(rowIndex, 1);
17661766
}
17671767
// hide column
17681768
else if (CONTEXTMENU_TYPES.HIDE_COLUMN === type) {

0 commit comments

Comments
 (0)