使用泥式衬衫,如何在页面底部获得持久的抽屉?

发布于 2025-01-21 03:00:14 字数 334 浏览 1 评论 0原文

查看此文档: https://mudblazor.com/components/components/drawer

我可以得到一个临时抽屉在页面底部,这不满足我的需求,因为我希望它在用户导航我的网站的其余部分时保持打开状态。我也不希望其余的屏幕变黑。

我可以在页面的左侧或右侧获得一个持久的抽屉,但这也不满足我的需求,因为它必须在底部。

锚点和绘画的任何组合。

做这项工作的正确方法是什么?

Looking at this documentation: https://mudblazor.com/components/drawer

I can get a temporary drawer on the bottom of the page, this doesn't meet my needs as I want it to remain open while the user navigates the rest of my website. I also don't want the rest of the screen to go dark.

I can get a persistent drawer on the left or right of my page, but that doesn't meet my needs either as it must be on the bottom.

Any combination of Anchor.Bottom and DrawerVariant.Persistent that I have tried does not compile.

What is the correct way to make this work?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

很糊涂小朋友 2025-01-28 03:00:14

遵循泥打饼干的例子:

<MudDrawer @bind-Open="@open" Elevation="1" Variant="@DrawerVariant.Persistent" Color="Color.Primary" Anchor="@anchor" DisableOverlay="true" Style="left: 0; top:auto; bottom: 0; width: 100%; height: auto">
        <MudDrawerHeader>
            <MudText Typo="Typo.h6">Test</MudText>
        </MudDrawerHeader>
        <MudNavMenu>
            <MudNavLink Match="NavLinkMatch.All">test 1</MudNavLink>
            <MudNavLink Match="NavLinkMatch.All">test 2</MudNavLink>
            <MudNavLink Match="NavLinkMatch.All">test 3</MudNavLink>
        </MudNavMenu>
    </MudDrawer>
    <div class="d-flex justify-center align-center mud-height-full">
        <MudButton Variant="Variant.Text" OnClick="@(() => OpenDrawer(Anchor.Bottom))">Bottom</MudButton>
    </div>
@code {

bool open = false;
Anchor anchor;

void OpenDrawer(Anchor anchor)
{
    
    open = true;
    this.anchor = anchor;
}

}

它在内部进入Mudblazor(如果您想要的话也可能是在Git上报告的问题)。我已经对其进行了测试,这起作用了。我所做的是检查并查看临时抽屉和持久性的差异,只有临时抽屉才能修改锚。因此,如果您将这些样式添加到抽屉中,则应该有效。

另外,暗屏覆盖,当您调用组件时,可以使用 disableOverlay =“ true” 将其禁用

Following the Mud blazor example:

<MudDrawer @bind-Open="@open" Elevation="1" Variant="@DrawerVariant.Persistent" Color="Color.Primary" Anchor="@anchor" DisableOverlay="true" Style="left: 0; top:auto; bottom: 0; width: 100%; height: auto">
        <MudDrawerHeader>
            <MudText Typo="Typo.h6">Test</MudText>
        </MudDrawerHeader>
        <MudNavMenu>
            <MudNavLink Match="NavLinkMatch.All">test 1</MudNavLink>
            <MudNavLink Match="NavLinkMatch.All">test 2</MudNavLink>
            <MudNavLink Match="NavLinkMatch.All">test 3</MudNavLink>
        </MudNavMenu>
    </MudDrawer>
    <div class="d-flex justify-center align-center mud-height-full">
        <MudButton Variant="Variant.Text" OnClick="@(() => OpenDrawer(Anchor.Bottom))">Bottom</MudButton>
    </div>
@code {

bool open = false;
Anchor anchor;

void OpenDrawer(Anchor anchor)
{
    
    open = true;
    this.anchor = anchor;
}

}

The problem it's internally into mudblazor (also if you want could be an issue to report on git). I already test it and this works. What i did it's inspect and see the difference between Temporary drawer and Persistent one, and only the temporary allows you to modify the Anchor. So if you add those styles to the drawer it should work.

Also the dark screen its the Overlay, when you call the component you can disable it with DisableOverlay="true"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文