first commit
This commit is contained in:
14
frontend/node_modules/antd/es/table/hooks/useContainerWidth.js
generated
vendored
Normal file
14
frontend/node_modules/antd/es/table/hooks/useContainerWidth.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
export default function useContainerWidth(prefixCls) {
|
||||
const getContainerWidth = (ele, width) => {
|
||||
const container = ele.querySelector(`.${prefixCls}-container`);
|
||||
let returnWidth = width;
|
||||
if (container) {
|
||||
const style = getComputedStyle(container);
|
||||
const borderLeft = Number.parseInt(style.borderLeftWidth, 10);
|
||||
const borderRight = Number.parseInt(style.borderRightWidth, 10);
|
||||
returnWidth = width - borderLeft - borderRight;
|
||||
}
|
||||
return returnWidth;
|
||||
};
|
||||
return getContainerWidth;
|
||||
}
|
||||
Reference in New Issue
Block a user