我希望垂直滚动条仅针对<MudMainContent>而不是整个<MudLayout>

问题描述 投票:0回答:1

我希望垂直滚动条仅针对 MudMainContent 自动显示,而不是整个 MudLayout,但垂直滚动条现在针对整个 MudMainContent 显示,以便当我的数据溢出并且垂直滚动时,某些内容隐藏在应用栏空间内。我想向 headerA 添加一些滚动功能,当我单击 我的链接到标题 A 的书签时,它应该滚动并带我到 headerA,但我的 headerA 隐藏在 Appbar 内,并且 headerA 下面的文本显示可见。我只希望 MudMainContent 自动出现垂直滚动条,这样我的 HeaderA 隐藏问题就可以得到解决。

参考功能,当我单击“我的链接”将书签添加到 HeaderA 时,它应该滚动并带我到 headerA :

https://www.w3schools.com/html/html_links_bookmarks.asp

复制链接:

https://try.mudblazor.com/snippet/cOwoFYbBfGLkebMU

我的问题的图片如下: enter image description here

我想要的是下图: enter image description here

layout blazor mudblazor vertical-scrolling vertical-scroll
1个回答
0
投票
您可以尝试以下

<style> .container { display: flex; flex-direction: column; height: 100vh; } .content { flex: 1; overflow-y: auto; } </style> <MudLayout Class="container"> <MudAppBar> <MudSwitch @bind-Value="_isDarkMode" Color="Color.Primary" Class="ma-4" T="bool" Label="Toggle Light/Dark Mode" /> </MudAppBar> <MudMainContent Class="content"> ...
测试


enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.