Skip to content

Commit

Permalink
Fix the bug that the console warns "Resizer column needs set column w…
Browse files Browse the repository at this point in the history
…idth" when the column width dragging function is grouped in the header
  • Loading branch information
huangshuwei committed Dec 11, 2022
1 parent 10f639d commit 63f3cf9
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
12 changes: 12 additions & 0 deletions CHANGE-LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ Vx.x.x(TPL)
- Style changes
- Dependencies Changes

V2.21.9

### Bug Fixes

- Fix the bug that the console warns "Resizer column needs set column width" when the column width dragging function is grouped in the header

---

### Bug Fixes

- 修复列宽拖动功能在表头分组时,控制台警告提示“Resizer column needs set column width”的问题

V2.21.8

### Breaking Changes
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-easytable",
"version": "2.21.8",
"version": "2.21.9",
"main": "libs/main.js",
"description": "Vue table component",
"keywords": [
Expand Down Expand Up @@ -136,7 +136,7 @@
"docVersions": [
{
"value": "/vue-easytable",
"label": "2.21.8"
"label": "2.21.9"
},
{
"value": "/vue-easytable/2.20.2",
Expand Down
23 changes: 22 additions & 1 deletion packages/ve-table/src/column-resizer/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,12 @@ export default {

const col = this.colgroups.find((x) => x.key === column.key);

if (col && col._realTimeWidth) {
// 表头分组,不支持分组表头列宽拖动
if (!col) {
return false;
}

if (col._realTimeWidth) {
const target = event.target;
const cellRect = target.getBoundingClientRect();
const { height, left, top } = cellRect;
Expand All @@ -123,6 +128,22 @@ export default {
} else {
console.warn("Resizer column needs set column width");
}

// if (col && col._realTimeWidth) {
// const target = event.target;
// const cellRect = target.getBoundingClientRect();
// const { height, left, top } = cellRect;

// this.columnResizerRect.left =
// left + col._realTimeWidth - tableContainerLeft;
// this.columnResizerRect.top = top - tableContainerTop;
// this.columnResizerRect.height = height;

// this.currentResizingColumn = col;
// this.columnResizerStartX = left + col._realTimeWidth;
// } else {
// console.warn("Resizer column needs set column width");
// }
}
},

Expand Down

0 comments on commit 63f3cf9

Please sign in to comment.