Skip to content

Commit 5ce0e12

Browse files
committed
bug fixed #467
1 parent b150ec2 commit 5ce0e12

File tree

3 files changed

+40
-12
lines changed

3 files changed

+40
-12
lines changed

CHANGE-LOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@ Vx.x.x(TPL)
77
- Style changes
88
- Dependencies Changes
99

10+
V2.15.1
11+
12+
### Bug Fixes
13+
14+
- Fix the bug that multiple tables have fixed columns, and only one is effective #467
15+
- Fix the bug that multiple right-click menu component options are suspended and only one takes effect
16+
17+
---
18+
19+
### Bug Fixes
20+
21+
- 修复多个表格包含固定列功能,只有一个生效的问题 #467
22+
- 修复多个右键菜单选项悬浮,只有一个生效的问题
23+
1024
V2.15.0
1125

1226
### Feature

packages/ve-contextmenu/src/index.jsx

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ export default {
224224
},
225225

226226
// create panel by hover
227-
createPanelByHover: debounce(function ({ event, menu }) {
227+
createPanelByHover({ event, menu }) {
228228
const { internalOptions, panelOptions } = this;
229229

230230
// 如果被移除则不创建
@@ -279,7 +279,7 @@ export default {
279279
});
280280
});
281281
}
282-
}, 300),
282+
},
283283

284284
// create panels option
285285
createPanelOptions({ options, currentMenu }) {
@@ -549,6 +549,14 @@ export default {
549549
},
550550
},
551551

552+
created() {
553+
// bug fixed #467
554+
this.debounceCreatePanelByHover = debounce(
555+
this.createPanelByHover,
556+
300,
557+
);
558+
},
559+
552560
mounted() {
553561
this.addRootContextmenuPanelToBody();
554562
},
@@ -564,7 +572,7 @@ export default {
564572
activeMenuIds,
565573
hasChildren,
566574
emptyContextmenuPanels,
567-
createPanelByHover,
575+
debounceCreatePanelByHover,
568576
} = this;
569577

570578
const contextmenuProps = {
@@ -625,10 +633,12 @@ export default {
625633
mouseover: (event) => {
626634
// disable
627635
if (!menu.disabled) {
628-
createPanelByHover({
629-
event,
630-
menu,
631-
});
636+
debounceCreatePanelByHover(
637+
{
638+
event,
639+
menu,
640+
},
641+
);
632642
}
633643
},
634644
click: () => {

packages/ve-table/src/index.jsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -645,14 +645,14 @@ export default {
645645
this.footerRows.splice(rowIndex, 1, { rowHeight: height });
646646
},
647647

648-
// td width change
649-
tdWidthChange: debounce(function (colWidths) {
648+
tdWidthChange(colWidths) {
649+
console.log("colWidths::", colWidths);
650650
this.colgroups = this.colgroups.map((item) => {
651651
// map
652652
item._realTimeWidth = colWidths.get(item.key);
653653
return item;
654654
});
655-
}, 0),
655+
},
656656

657657
// update colgroups by sort change
658658
updateColgroupsBySortChange(sortColumns) {
@@ -1958,6 +1958,10 @@ export default {
19581958
this.highlightRowKey = rowKey;
19591959
},
19601960
},
1961+
created() {
1962+
// bug fixed #467
1963+
this.debouncedTdWidthChange = debounce(this.tdWidthChange, 0);
1964+
},
19611965
mounted() {
19621966
this.parentRendered = true;
19631967

@@ -2041,7 +2045,7 @@ export default {
20412045
fixedHeader,
20422046
fixedFooter,
20432047
actualRenderTableData,
2044-
tdWidthChange,
2048+
debouncedTdWidthChange,
20452049
expandOption,
20462050
checkboxOption,
20472051
radioOption,
@@ -2105,7 +2109,7 @@ export default {
21052109
showVirtualScrollingPlaceholder,
21062110
},
21072111
on: {
2108-
[EMIT_EVENTS.BODY_TD_WIDTH_CHANGE]: tdWidthChange,
2112+
[EMIT_EVENTS.BODY_TD_WIDTH_CHANGE]: debouncedTdWidthChange,
21092113
[EMIT_EVENTS.HIGHLIGHT_ROW_CHANGE]:
21102114
this[INSTANCE_METHODS.SET_HIGHLIGHT_ROW],
21112115
},

0 commit comments

Comments
 (0)