Skip to content

Commit 2750554

Browse files
committed
Update index.jsx
1 parent 49ba441 commit 2750554

File tree

1 file changed

+0
-52
lines changed
  • packages/ve-table/src/column-resizer

1 file changed

+0
-52
lines changed

packages/ve-table/src/column-resizer/index.jsx

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@ export default {
99
type: Boolean,
1010
required: true,
1111
},
12-
tableRootEl: {
13-
type: HTMLDivElement,
14-
default: null,
15-
},
16-
tableContainerWrapperInstance: {
17-
type: Object,
18-
default: null,
19-
},
2012
tableContainerEl: {
2113
type: HTMLDivElement,
2214
default: null,
@@ -49,10 +41,6 @@ export default {
4941
type: Function,
5042
required: true,
5143
},
52-
setTableWidth: {
53-
type: Function,
54-
required: true,
55-
},
5644
// column width resize option
5745
columnWidthResizeOption: {
5846
type: Object,
@@ -192,13 +180,10 @@ export default {
192180
// column resizer mouseup
193181
columnResizerMouseup(event) {
194182
const {
195-
tableRootEl,
196-
tableContainerWrapperInstance,
197183
isColumnResizing,
198184
currentResizingColumn,
199185
columnResizerStartX,
200186
setColumnWidth,
201-
setTableWidth,
202187
columnWidthResizeOption,
203188
columnMinWidth,
204189
} = this;
@@ -226,49 +211,19 @@ export default {
226211
let nextColumnWidth = currentResizingColumn._realTimeWidth;
227212
nextColumnWidth += differWidth;
228213

229-
const { width: preTableWidth } =
230-
tableContainerWrapperInstance.$el.getBoundingClientRect();
231-
let nextTableWidth;
232-
233-
const nextTotalColumnsWidth =
234-
this.getTotalColumnsWidth() + differWidth;
235-
236-
if (differWidth > 0) {
237-
const { width: tableRootWidth } =
238-
tableRootEl.getBoundingClientRect();
239-
240-
if (preTableWidth + differWidth > tableRootWidth) {
241-
nextTableWidth = tableRootWidth;
242-
} else {
243-
nextTableWidth = preTableWidth + differWidth;
244-
}
245-
} else {
246-
if (preTableWidth + differWidth < nextTotalColumnsWidth) {
247-
nextTableWidth = preTableWidth;
248-
} else {
249-
nextTableWidth = preTableWidth + differWidth;
250-
}
251-
}
252-
253-
nextTableWidth = Math.floor(nextTableWidth);
254-
255214
// set column width
256215
setColumnWidth({
257216
colKey: currentResizingColumn.key,
258217
width: nextColumnWidth,
259218
});
260219

261-
// set table width
262-
setTableWidth(nextTableWidth);
263-
264220
if (columnWidthResizeOption) {
265221
const { sizeChange } = columnWidthResizeOption;
266222
sizeChange &&
267223
sizeChange({
268224
column: currentResizingColumn,
269225
differWidth,
270226
columnWidth: nextColumnWidth,
271-
tableWidth: nextTableWidth,
272227
});
273228
}
274229
}
@@ -298,13 +253,6 @@ export default {
298253
return true;
299254
};
300255
},
301-
302-
// get total columns width
303-
getTotalColumnsWidth() {
304-
return this.colgroups.reduce((total, currentVal, index) => {
305-
return currentVal._realTimeWidth + total;
306-
}, 0);
307-
},
308256
},
309257

310258
render() {

0 commit comments

Comments
 (0)