从不同的组件中保存纳维托的高度到redux
我是一个新的React用户。几天来,我一直在处理这样的任务。我有一个包含许多组件和redux的项目。我们还有一个使用反应室的Navbar。我需要将Navbar的高度添加到React-Redux并在切换到另一个组件时进行更新,以便可以根据此设置该视图的内容的保证金顶部。目前,Navbar掩盖了我观点的内容。我该如何实现?有人可以给我写一些简单的临时代码吗?先感谢您。
编辑:应用程序中的某些视图有一个附加的栏,其中包含信息。从一个角度看,这个栏可能更长。我希望组件中的内容被给定的Navbar高度从顶部偏移(目前)。我想到将Navbar高度存储在Redux中,并以某种方式在组件之间切换时,检查高度并更新内容的保证金顶部。
不幸的是,我正在纠正某人之后,Navbar已修复,我们无法更改它。
I am a new react user. I have been struggling with a task like this for a few days. I have a project that contains many components and redux. We also have a navbar that uses react-headroom. I need to add the height of that navbar to react-redux and update it when I switch to another component, so that I can set the margin-top for the content of that view based on that. Currently the navbar is obscuring the content of my view. How can I make this happen? Could someone please write me some simple, makeshift code of what this would look like? Thank you in advance.
EDIT: Some views in the app have an additional bar with information. On one view this bar may be longer on another shorter. I would like the content in the component to be offset from the top by a given navbar height (for the moment). I thought of storing the navbar height in redux, and somehow, when switching between components, check the height and update the margin-top for the content.
Unfortunately, I am correcting this after someone, the navbar is fixed, and we cannot change it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论