Skip to content

Commit 1b6eb19

Browse files
committed
Update index.jsx
1 parent 142f007 commit 1b6eb19

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

packages/ve-table/src/colgroup/index.jsx

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,24 @@ export default {
77
type: Array,
88
required: true,
99
},
10+
enableColumnResize: {
11+
type: Boolean,
12+
required: true,
13+
},
1014
},
1115
methods: {
1216
getValByUnit(item) {
13-
// 解决使用 _realTimeWidth 在多表头下宽度计算异常的问题
14-
return getValByUnit(
15-
item._realTimeWidth ? item._realTimeWidth : item.width,
16-
);
17+
const { enableColumnResize } = this;
18+
19+
let width;
20+
// 开启 column resize
21+
if (enableColumnResize) {
22+
// 解决使用 _realTimeWidth 在多表头下宽度计算异常的问题
23+
width = item._realTimeWidth ? item._realTimeWidth : item.width;
24+
} else {
25+
width = item.width;
26+
}
27+
return getValByUnit(width);
1728
},
1829
},
1930
render() {

0 commit comments

Comments
 (0)