nz-option 就像一个默认值

问题描述

目前我正在处理 3 个事物的预加载信息,2 个选择选项和一个表,“业务对象”和“表”填充得很好,替换了 ngModel 变量的值,但是,对于 fileName,同样的事情没有发生;文件名就像唯一的“选项”一样,但没有“认”选择,我试图用“defaultValue”来管理它,就像文档说的那样,但不起作用。知道我该怎么做吗?

这是我的实际代码

ngOnInit(): void {
      this.sel_businessObject = JSON.parse(localStorage.getItem("businessObjSelected"));
      this.fileNametoEdit = JSON.parse(localStorage.getItem("fileNameSelected"));
      console.log('LALALALA',this.fileNametoEdit);
      this.dataMappingData = JSON.parse(localStorage.getItem("dataMappingCashedData"));

        // Call API to Load Business Object
        this.mappingService.businessObject().subscribe((business: any) => {
            //debugger;
            this.listBusinessObj = business;
        })

<div class="col col-4">
<label> Data Filename
<small>*</small>
</label> <br />
<nz-select nzShowSearch nzAllowClear nzPlaceHolder="Select Filename" name="sel_fileName"
[(ngModel)]="this.sel_fileName" (ngModelChange)="fileNameListChangeEvt()">
<nz-option *ngFor="let fineName of listFileNameObj" [nzLabel]="fineName"
[nzValue]="fineName"></nz-option>
<nz-option *ngIf="fileNametoEdit !== 'null'" [nzLabel]="this.fileNametoEdit"
[nzValue]="this.fileNametoEdit"></nz-option>
</nz-select>
</div>

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)