分类

链接

2024 年 9 月
 1
2345678
9101112131415
16171819202122
23242526272829
30  

近期文章

热门标签

新人福利,免费薅羊毛

现在位置:    首页 > .NET > 正文
解决.NET Blazor子组件不刷新问题
.NET 暂无评论 阅读(17)

子组件Room:

@code { 

    [Parameter]
    public int filterOfficeId { get; set; } = 0;

    protected override Task OnParametersSetAsync()
    {
        this.pageIndex = 1;
        onSearch();

        return base.OnParametersSetAsync();

    }

 

父组件Office:

  <Button Size="small" @onclick="() => showRooms(context.Title,context.Id)">管理</Button>

<Modal Visible="roomPopup" Width="1200" MaskClosable="false" Title="@("【"+officeTitle+"】")" OnCancel="onClose" Footer="null">
    <Room filterOfficeId="@officeId"></Room>
</Modal>

@code { 
    private bool roomPopup { get; set; } = false;
    private int officeId { get; set; } = 0;

    void showRooms(string title, int id)
    {
        officeId = id; 
        roomPopup = true;
    }

}

 

============ 欢迎各位老板打赏~ ===========

本文版权归Bruce's Blog所有,转载引用请完整注明以下信息:
本文作者:Bruce
本文地址:解决.NET Blazor子组件不刷新问题 | Bruce's Blog

发表评论

留言无头像?