@huibo-ui/react-antd 1.0.12 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/Layout.js +9 -4
- package/package.json +1 -1
package/lib/components/Layout.js
CHANGED
|
@@ -32,12 +32,17 @@ Layout.Sider = function Sider({ children, style, className, collapsed, theme, wi
|
|
|
32
32
|
/**
|
|
33
33
|
* Content —— 主内容区。flex:1 撑满剩余空间。
|
|
34
34
|
*
|
|
35
|
-
* 对齐 antd .ant-layout-content(flex: auto + min-height: 0
|
|
36
|
-
*
|
|
37
|
-
*
|
|
35
|
+
* 对齐 antd .ant-layout-content(flex: auto + min-height: 0)。
|
|
36
|
+
*
|
|
37
|
+
* 过滤消费方传入的 height:'auto':这是常见脆弱写法,会让 flex item 的
|
|
38
|
+
* height 指定值变成 auto,导致子元素 height:100% 解析失败(如全屏背景图
|
|
39
|
+
* 容器)。去掉它让 flex 算法自然分配高度,子元素 height:100% 才能生效。
|
|
38
40
|
*/
|
|
39
41
|
Layout.Content = function Content({ children, style, className }) {
|
|
40
|
-
|
|
42
|
+
const { height, ...restStyle } = style || {};
|
|
43
|
+
// 仅过滤无效的 height:'auto';显式数值/百分比仍保留
|
|
44
|
+
const filteredStyle = height === 'auto' ? restStyle : style;
|
|
45
|
+
return (_jsx("div", { style: { flex: '1 1 auto', minWidth: 0, minHeight: 0, ...filteredStyle }, className: className, children: children }));
|
|
41
46
|
};
|
|
42
47
|
/**
|
|
43
48
|
* Footer —— 页脚。固定高度。
|