NG-ZORRO / ng-zorro-antd-mobile

A configurable Mobile UI components based on Ant Design Mobile and Angular. 🐜
http://ng.mobile.ant.design
Other
800 stars 241 forks source link

在Modal 组件中调用 pickerview 组件 动态设置 pickerview 初始值不生效 #715

Closed HuaJiuZ closed 2 years ago

HuaJiuZ commented 4 years ago

<Modal [(ngModel)]="isBusinessHours" [popup]="true" [animationType]="'slide-up'" (onClose)="onCloseBusinessHours()">
<PickerView [data]="startSeasons" [cols]="1" [cascade]="true" [(ngModel)]="startTime" (ngModelChange)="onChangeStart($event)"> startSeasons:动态从服务器获取数据 startTime:设置初始值 (不生效)

nuonuoge commented 4 years ago

You can use it like this to avoid error

<PickerView *ngIf="startSeasons && startSeasons.length >0" [data]="startSeasons" [cols]="1" [cascade]="true" [(ngModel)]="startTime"
(ngModelChange)="onChangeStart($event)">
nuonuoge commented 4 years ago

https://github.com/NG-ZORRO/ng-zorro-antd-mobile/pull/718