0

我像这样使用 Virtualize 组件:

<Virtualize Items="Items" Context="row">
   <Row Data="row" @key="row" />
</Virtualize>

如何获取对当前<Row>组件的引用?

我需要对它们显式调用刷新。

4

1 回答 1

0

我想你可以这样做:

<Virtualize Items="Items" Context="row">
    <Row Data="row" @key="row" @ref="references[row.id]" />
</Virtualize>

@code {

    IDictionary<string, ElementReference> references = new Dictionary<string, ElementReference>()
    {
        { "<first row id>", new ElementReference() },
        { "<second row id>", new ElementReference() },
        { "<third row id>", new ElementReference() },
        
        ...      
    };

}
于 2021-02-16T18:44:09.543 回答