angular8 antd design 中Select选择器allowClear清除属性失效和单个点击删除
解决方法1:
参考链接:https://blog.51cto.com/u_15064644/4338712
解决方法二:changeDetectorRef.detectChanges()
<nz-select nzMode="tags" name="tests" [(ngModel)]="testSetupInfo.tests" (ngModelChange)="testsChange(testSetupInfo)"
nzPlaceHolder="请选择考试试题" nzAllowClear>
<nz-option *ngFor="let option of editData.testsList" [nzValue]="option.id" [nzLabel]="option.title"></nz-option>
</nz-select>
testsChange(testSetupInfo: any) {
this.changeDetectorRef.detectChanges(); // 实时检测数据的变化并更新视图数据
}
浙公网安备 33010602011771号