Skip to content

[Question] Set Logo BaseURL in BasicLayout Layout.Mix mode? Β #199

@valentinmarinro

Description

@valentinmarinro

Hi, I need to cancel the a->href behaviour in the logo, trying to set the href="javascript:void(0)", but in Layout.Mix mode only the default value is taking in account "/".

I found the code in the pro components repo, in SiderMenu.razor, but found not way to override it in ant design pro BasicLayout

    @if (HeaderDom != null)
    {
        <div id="logo" class="@BaseClassName-logo" @onclick="OnMenuHeaderClick">
            @HeaderDom
        </div>
    }
RenderFragment HeaderDom => DefaultRenderLogoAndTitle();
RenderFragment DefaultRenderLogoAndTitle()
{
    if (!MenuHeaderRender)
    {
        return null;
    }

    var logoDom = DefaultRenderLogo();
    RenderFragment titleDom = @<h1>@Title</h1>;

    if (Collapsed)
    {
        titleDom = null;
    }

    if (Layout == Layout.Mix)
    {
        return null;
    }

    return @<a href="@BaseURL">
               @logoDom
               @titleDom
           </a>;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions