当我在回调函数中时,我尝试在子组件中调用一个函数。
在我的子组件中:
<div class="container">
<h1 class="text-center">DUO BUSINESS</h1><i class="fal @IcoMenu" @onclick="CollapseMenu"></i>
@code{
[Parameter]
public EventCallback CollapseMenu { get; set; }
public void Popover()
{
Console.WriteLine("test");
}
}
在我的父组件中:
private void CollapseMenu()
{
if (collapseMenu == "vxs-left-side-menu")
{
this.collapseMenu = "vxs-left-side-menu vxs-left-side-menu-collapse";
this.icoMenu = "fa-yin-yang";
}
else
{
this.collapseMenu = "vxs-left-side-menu";
this.icoMenu = "fa-times";
------------HERE I WANT TO DO A FUNCTION IN CHILD COMPONENT------------
Do popoverFunction in child component
}
}