Angular2 primeNG的p-dropdown的选中值未初始化

时间:2022-02-26 19:25:14
 
1 <p-dropdown name="adjustflagId" class="dp-position" [options]="codeTable.adjustAccountFlag"
2             [(ngModel)]="editObj.adjustflagId" [style]="{'width': '124px'}" required></p-dropdown>
3 <p-dropdown name="adjustflagId" class="dp-position" [options]="codeTable.nameArr"
4             [(ngModel)]="editObj.name" [style]="{'width': '124px'}" required></p-dropdown>

代码复制的,name属性相同所致。