html - 怎么做材料 ui 抽屉演示中的 100% 高度
问题描述
我有一个 Material UI 抽屉问题。对于我的项目,我想要主标签的背景颜色,但问题是主标签只和里面的内容一样高。
https://codesandbox.io/s/material-demo-forked-djfll?file=/demo.js
我可以将高度设置为“100vh”,使其成为全屏尺寸,但是如果我输入更多数据,它不会填满整个屏幕
宽度:'100%' 很少内容 https://i.stack.imgur.com/D2l1A.png 很多内容 https://i.stack.imgur.com/avtXE.png
宽度:'100vh' 很少内容 https://i.stack.imgur.com/MNZYK.png 很多内容 https://i.stack.imgur.com/YEs7L.png
解决方案
content: {
flexGrow: 1,
padding: theme.spacing(3),
height: window.innerHeight, // <= You Need This Line
background: "yellow"
}
推荐阅读
- linux - 修改每个节点的核心转储磁盘空间利用率
- svg - 为什么 SVG Mask 可以用于生产但不能用于暂存?
- youtube-data-api - Google 表格 (IMPORTXML fnc) 中的 YouTube 导入数据已停止工作
- python - 无法理解为什么加入 re.findall 的索引从 1 而不是 0 开始
- javascript - 如何检查数组索引是否为空/空?
- npm - npm 错误!errno UNABLE_TO_VERIFY_LEAF_SIGNATURE 失败,原因:无法验证第一个证书
- naudio - 使用 NAudio MixingSampleProvider 后听力削波
- javascript - scrollTo 不能分别滚动两个元素
- apache-flink - 如何在 Apache flink KeyedBroadCastProcessFunction 中处理异常
- android - 改造错误:- 预期 BEGIN_ARRAY 但在路径 $ 处是 BEGIN_OBJECT