dotnet/aspnetcore
Suggestion: Expose a parameter of `ShouldMatch` for `<NavLink />`
已關閉
#18,163 建立於 2020年1月7日
Priority:1affected-fewarea-blazorenhancementfeature-blazor-builtin-componentshelp wantedseverity-minor
倉庫指標
- 星標
- (37,933 顆星)
- PR 合併指標
- (平均合併 16天 9小時) (30 天內合併 258 個 PR)
描述
Is your feature request related to a problem? Please describe.
I want to custom the matching behavior of <NavLink />.
Let's say we want to process a url with a hash(See this thread on SO) :
http://localhost/#an-element-id
Sometimes we might think this url matches http://localhost , while some other users don't think so.
It would be great if we are allowed to custom this matching behavior. Usually, we can custom by inheritance or composition. However, the matching logic is hardcoded for the present.
- There's no
public/protectedShouldMatch(string)method exposed. So it's difficult to achieve it by inheritance - There's no
ShouldMatchparameter exposed. It would be great if we can pass aShouldMatch[Parameter]to this component.
Describe the solution you'd like
Expose a [Parameter] of ShouldMatch(string):
- if user provides such a parameter, use it.
- Otherwise, use the default logic.