我希望垂直滚动条仅针对 MudMainContent 自动显示,而不是整个 MudLayout,但垂直滚动条现在针对整个 MudMainContent 显示,以便当我的数据溢出并且垂直滚动时,某些内容隐藏在应用栏空间内。我想向 headerA 添加一些滚动功能,当我单击 我的链接到标题 A 的书签时,它应该滚动并带我到 headerA,但我的 headerA 隐藏在 Appbar 内,并且 headerA 下面的文本显示可见。我只希望 MudMainContent 自动出现垂直滚动条,这样我的 HeaderA 隐藏问题就可以得到解决。
参考功能,当我单击“我的链接”将书签添加到 HeaderA 时,它应该滚动并带我到 headerA :https://www.w3schools.com/html/html_links_bookmarks.asp
复制链接:
<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">
...
测试