Giter Club home page Giter Club logo

blazor-pro-components's Issues

cannot customize the language menu items

could you please update the parameters in SelectLang component to "CascadingParameter"? Then the language menu items can be customized without changing the layout component.

更新到0.18.2后,菜单刷新无法自动选中高亮

更新到0.18.2后,刷新无法自行选中.
在0.18.1时候没有问题,在未更改代码前提下升级0.18.2后,
刷新页面,首次加载左菜单后,无法自动将选中的当前菜单赋予高亮颜色.

此时点击其它菜单会有高亮

Drawer effect of side navigation bar in mobile terminal

Antd Pro will become a drawer effect on the mobile terminal. I tried to use the drawer component to achieve it, but the custom effect of the drawer component is relatively weak. I found that this has been implemented in Docs. Can it be introduced into Prolayout? In the default implementation?
image

BasicLayout -Menu event

How to create MenuItemClick event ?

< BasicLayout MenuData="MenuData" SiderWidth="300" >
< BasicLayout />

Can BaseMenu add IconFont support?

static readonly RenderFragment<MenuDataItem> title= menuItem => @<span>
                                                                    @if (!string.IsNullOrEmpty(menuItem.Icon))
                                                                    {
                                                                        <Icon Type="@menuItem.Icon" Theme="outline"  />
                                                                    }
                                                                   @if (!string.IsNullOrEmpty(menuItem.IconFont))
                                                                    {
                                                                        <IconFont Type="@menuItem.IconFont" />
                                                                    }


public class MenuDataItem
{
    public string[] Authority { get; set; }
    public virtual MenuDataItem[] Children { get; set; }
    public bool HideChildrenInMenu { get; set; }
    public bool HideInMenu { get; set; }
    public string Icon { get; set; }
    public string IconFont { get; set; }  //Add
    public string Locale { get; set; }
    public virtual string Name { get; set; }
    public string Key { get; set; }
    public string Path { get; set; }
    public string[] ParentKeys { get; set; }
    public NavLinkMatch Match { get; set; }
}

}

Defaults for AntDesign.Pro

So I've been doing some changes in my project so I can use AntDesign.Pro. I noticed there is a ton of stuff that leaks from AntDesign.Pro to pro-components. What I mean is for example in AvatarDropdown the menu options are basically just hardcoded stuff that is needed to show-off AntDesign.Pro. This makes the components in that state useless. Same thing for SelectLang. What I'd like to do is to make it more flexible. What I want to do is just do a PR that will have a number of changes spanning through a number of different components. But on top of that, the changes would require also a separate PR in AntDesign.Pro. I figured since I do those changes in my project, I could apply them to the source 😉.

I want to do these big PRs because I do not know how long it is going to take it to merge if each change is done as a separate PR. And that will be really hard for me continue working on my stuff & keep multiple PRs... So is that going to be ok with you guys?

多应用共享MenuData时,出现折叠问题

OGW4N LO$TFKUR61Q4GX YX

我这里后台是多应用模式+共享左边的菜单。
应用切换后,菜单也会随之变化。

<BasicLayout Logo="@("https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg")"
             MenuData="leftMenus">
    <RightContentRender>
        <RightContent @bind-User="@User" MenuData="topMenus" MenuDataChanged="MenuChanged" />
    </RightContentRender>

当我topMenus(目前只有一级菜单)点击之后, leftMenus 会进行重新赋值。
左边的菜单内容会对应的刷新, 但是折叠状态依旧保留之间。
建议增加一个菜单折叠接口出来,或者内部判定当MenuData发生变化的时候, 重置菜单伸缩状态。

BaseMenu HideInMenu feature missing

Hi, I think HideInMenu feature is missing inside SiderMenu/BaseMenu.razor.

Current:

if (menuItem.Children != null && !menuItem.HideChildrenInMenu)
{
    <SubMenu TitleTemplate="@title(menuItem)" Key="@menuItem.Key">
        @menuItemTemplate((menuItem.Children, true))
    </SubMenu>
}
else
{
    <MenuItem Key="@menuItem.Key">
        <MenuLink href="@menuItem.Path" Match="@menuItem.Match">
            @title(menuItem)
        </MenuLink>
    </MenuItem>
}

To fix it:

if (menuItem.Children != null && !menuItem.HideChildrenInMenu)
{
    <SubMenu TitleTemplate="@title(menuItem)" Key="@menuItem.Key">
        @menuItemTemplate((menuItem.Children, true))
    </SubMenu>
}
else if (!menuItem.HideInMenu)
{
    <MenuItem Key="@menuItem.Key">
        <MenuLink href="@menuItem.Path" Match="@menuItem.Match">
            @title(menuItem)
        </MenuLink>
    </MenuItem>
}

Please correct me if I'm wrong. Thanks.

BasicLayout OnCollapse is not invoked

Hi there,

I believe HandleCollapse method should invoke OnCollapse event callback. Otherwise there is no way to detect when side menu is collapsed. Am I missing something?

private void HandleCollapse(bool collapsed)        
{  
Collapsed = collapsed;  
SetStyle();
}

should be

private void HandleCollapse(bool collapsed)
{
  Collapsed = collapsed;
  SetStyle();
  OnCollapse.InvokeAsync(collapsed);
}

模板创建的项目0.13.0.1版本升级到0.14版本,页面加载不出来报错了。

/__w/1/s/src/mono/mono/eglib/gpath.c:115
/__w/1/s/src/mono/mono/eglib/gpath.c:115
info: AntDesign.ProLayout.BasicLayout[0]
BasicLayout initialized.
info: AntDesign.ProLayout.BaseMenu[0]
BaseMenu initialized.
crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: No element is currently associated with component 11
Error: No element is currently associated with component 11
at ae.updateComponent (https://localhost:44358/_framework/blazor.webassembly.js:1:19821)
at https://localhost:44358/_framework/blazor.webassembly.js:1:56876
at St.Te._internal.renderBatch (https://localhost:44358/_framework/blazor.webassembly.js:1:57248)
at Object.Rt [as invokeJSFromDotNet] (https://localhost:44358/_framework/blazor.webassembly.js:1:59934)
at _mono_wasm_invoke_js_blazor (https://localhost:44358/_framework/dotnet.6.0.16.olpkzvz1qs.js:1:195300)
at wasm://wasm/00971dfe:wasm-function[3308]:0xc6137
at wasm://wasm/00971dfe:wasm-function[167]:0xd602
at wasm://wasm/00971dfe:wasm-function[166]:0xbd73
at wasm://wasm/00971dfe:wasm-function[2815]:0xabef4
at wasm://wasm/00971dfe:wasm-function[1619]:0x6fcb4
Microsoft.JSInterop.JSException: No element is currently associated with component 11
Error: No element is currently associated with component 11
at ae.updateComponent (https://localhost:44358/_framework/blazor.webassembly.js:1:19821)
at https://localhost:44358/_framework/blazor.webassembly.js:1:56876
at St.Te._internal.renderBatch (https://localhost:44358/_framework/blazor.webassembly.js:1:57248)
at Object.Rt [as invokeJSFromDotNet] (https://localhost:44358/_framework/blazor.webassembly.js:1:59934)
at _mono_wasm_invoke_js_blazor (https://localhost:44358/_framework/dotnet.6.0.16.olpkzvz1qs.js:1:195300)
at wasm://wasm/00971dfe:wasm-function[3308]:0xc6137
at wasm://wasm/00971dfe:wasm-function[167]:0xd602
at wasm://wasm/00971dfe:wasm-function[166]:0xbd73
at wasm://wasm/00971dfe:wasm-function[2815]:0xabef4
at wasm://wasm/00971dfe:wasm-function[1619]:0x6fcb4
at Microsoft.JSInterop.WebAssembly.WebAssemblyJSRuntime.InvokeUnmarshalled[Int32,RenderBatch,Object,Object](String identifier, Int32 arg0, RenderBatch arg1, Object arg2, Int64 targetInstanceId)
at Microsoft.JSInterop.WebAssembly.WebAssemblyJSRuntime.InvokeUnmarshalled[Int32,RenderBatch,Object](String identifier, Int32 arg0, RenderBatch arg1)
at Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer.UpdateDisplayAsync(RenderBatch& batch)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()

Support ProTable

I am so limited to my own technology, I can't provide PR, so I can only help the maintainer.

Question: RightContent.razor should not be a component?

I am having a problem justifying the RightContent.razor as a component. First it gave me a lot of trouble when I tried to use AntDesign.Pro full version. I will in steps describe what I did and what I noticed:

  1. I created a new AntDesign.MySite project using command line dotnet new antdesign --host=server --full
  2. I found the template created files (among others) Layouts/BasicLayout.razor and Components/GlobalHeader/RightContent.razor. The latter is responsible for rendering of notification center, language picker and quick user actons. That RightContent component is consumed by BasicLayout component.
  3. I wanted to do some customizations so I started changing the projects RightContent.razor. Whatever I was doing, no changes was reflected.
  4. Eventually I figured that the RightContent that was used was actually a component of pro-components. So I had to fully qualify the RightContent in BasicLayout like this: <AntDesign.MySite.Components.RightContent />
  5. I cannot use F12 yet on razor components (source). Figuring out the source of my problem took me much more time than it should 😢 .
  6. It seems that RightContent does not expose enough api to be useful, so it has to be altered anyway.

It absolutely makes sense to keep RightContent.razor as a part of AntDesign.Pro template, but I can only see it being as an obstacle at this stage if it is used in ProComponents.
In my tests I transferred all the code related to RightContent to AntDesign.Pro.Layout.Wasm project to folder Components/GlobalHeaders. Running the example project works as before.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.