2022-01-10 15:55:00 +08:00
|
|
|
|
@namespace AntDesign
|
2021-09-22 22:07:56 +08:00
|
|
|
|
@inherits AntDomComponentBase
|
|
|
|
|
@typeparam TItem
|
|
|
|
|
@using AntDesign.TableModels
|
|
|
|
|
|
|
|
|
|
@if (IsBody)
|
|
|
|
|
{
|
2022-01-10 15:55:00 +08:00
|
|
|
|
<tr @attributes="RowAttributes"
|
|
|
|
|
data-row-key="@(RowData.RowIndex-1)"
|
|
|
|
|
class="ant-table-row ant-table-row-level-@RowData.Level @(RowData.Selected ? "ant-table-row-selected" : "") @RowClassName @RowAttributes?.GetValueOrDefault("class")">
|
|
|
|
|
@ChildContent
|
|
|
|
|
</tr>
|
2021-09-22 22:07:56 +08:00
|
|
|
|
}
|
|
|
|
|
else if (IsHeader)
|
|
|
|
|
{
|
2022-01-10 15:55:00 +08:00
|
|
|
|
<tr @attributes="RowAttributes">
|
|
|
|
|
@ChildContent
|
2021-09-22 22:07:56 +08:00
|
|
|
|
</tr>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@code {
|
|
|
|
|
[Parameter]
|
|
|
|
|
public RenderFragment ChildContent { get; set; }
|
|
|
|
|
|
|
|
|
|
[CascadingParameter(Name = "IsHeader")]
|
|
|
|
|
public bool IsHeader { get; set; }
|
|
|
|
|
|
|
|
|
|
[CascadingParameter(Name = "IsBody")]
|
|
|
|
|
public bool IsBody { get; set; }
|
|
|
|
|
|
|
|
|
|
[CascadingParameter(Name = "RowData")]
|
|
|
|
|
public RowData<TItem> RowData { get; set; }
|
|
|
|
|
|
2022-01-10 15:55:00 +08:00
|
|
|
|
[CascadingParameter(Name = "AntDesign.TableRow.RowAttributes")]
|
|
|
|
|
public Dictionary<string, object> RowAttributes { get; set; }
|
2021-09-22 22:07:56 +08:00
|
|
|
|
|
2022-01-10 15:55:00 +08:00
|
|
|
|
[CascadingParameter(Name = "AntDesign.TableRow.RowClassName")]
|
|
|
|
|
public string RowClassName { get; set; }
|
2021-09-22 22:07:56 +08:00
|
|
|
|
}
|