1

我的数据表组件:


            <span>
                @foreach (var paginateButton in paginateButtonList)
                {
                    <PaginateButton @bind-IsCurrent="paginateButton.IsCurrent" @onclick="@(() => method(paginateButton))"></PaginateButton> 
                }
            </span>
    @code {
    
        IList<PaginateButton> paginateButtonList = new List<PaginateButton>()
        {
            new PaginateButton(){Name = "1"},
            new PaginateButton(){Name = "2"},
            new PaginateButton(){Name = "3"}
        };
    
    
        void method(PaginateButton pb)
        {
    
        }
    
        DataTablesRequest dataTablesRequestModel = new DataTablesRequest();
    }

当我将 paginateButton 发送到方法时,出现错误:

“DataTablesBlazorVersion.Components.DataTables.PaginateButton”没有与名称“onclick”匹配的属性。

4

0 回答 0