7

由于 html 解析 tr 然后 td,使用<cdk-virtual-scroll-viewport>中断视图是否有任何 cdkVirtualScrollViewport 作为指令<tbody>

<tbody>
<cdk-virtual-scroll-viewport  style="height: 500px; width: 100%;"  itemSize="100"
    <tr [hidden]="data.get_user.name.toLowerCase().indexOf(pupilFilter.name.toLowerCase()) < 0 || (pupilFilter.classValue != '0' && data.get_class.value != pupilFilter.classValue)" appMarkClicked="" *cdkVirtualFor="let data of top.data.branch.get_users_as_pupil; let i = index" >
        <td>{{i + 1}}</td>
    </tr>
</cdk-virtual-scroll-viewport>
</tbody>
4

1 回答 1

5

好吧,我可以把<cdk-virtual-scroll-viewport之前<table>

<cdk-virtual-scroll-viewport>
    <table>
    </table>
</cdk-virtual-scroll-viewport>
于 2018-11-04T05:01:56.393 回答