Angular 在值更改后,预处理表保存所选页面
我有一张简单的素描表Angular 在值更改后,预处理表保存所选页面,angular,primeng,Angular,Primeng,我有一张简单的素描表 <p-table [value]="users" [paginator]="true" [rows]="5"> <ng-template pTemplate="header"> <tr> <th>name</th> </tr> </ng-template> <ng-template pTemplate="
<p-table [value]="users"
[paginator]="true"
[rows]="5">
<ng-template pTemplate="header">
<tr>
<th>name</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-user>
<tr>
<td>{{user}}</td>
</tr>
</ng-template>
</p-table>
选择表中的第二页,然后将新值分配给此。用户
this.users = ['Gregor', 'Ronald'];
但表中仍然选择了第二个页面,所以表中并没有用户。现场观看
我只需删除第二页并单击“更改名称”。新名称不可见
有没有办法从代码中修复它?根据,你运气不好。不幸的是,当涉及到这些框架时,限制是生活的一部分
然而,你总是可以用锤子和炸药的方法来破解它
必须使用此修复程序,谢谢
this.users = ['Gregor', 'Ronald'];