Get hooks by current layout.

Fix #17394
pull/17400/head
maliming 1 year ago
parent 59b9843433
commit 777abd048a
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4

@ -18,9 +18,9 @@ public class LayoutHookViewComponent : AbpViewComponent
public virtual IViewComponentResult Invoke(string name, string layout)
{
var hooks = Options.Hooks.GetOrDefault(name)?.Where(IsViewComponent).ToArray()
?? Array.Empty<LayoutHookInfo>();
var hooks = Options.Hooks.GetOrDefault(name)?.Where(x => x.Layout == layout && IsViewComponent(x)).ToArray()
?? Array.Empty<LayoutHookInfo>();
return View(
"~/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/Default.cshtml",
new LayoutHookViewModel(hooks, layout)

Loading…
Cancel
Save