猿问

Modal确认回调后不自动消失

<nz-modal [(nzVisible)]="isShow" [nzTitle]="title" [nzContent]="modalContent" [nzFooter]="modalFooter" (nzOnCancel)="handleCancel()">
<ng-template #modalContent>

<div  class="content"></div>

</ng-template>
<ng-template #modalFooter>

<button nz-button [nzType]="'primary'" (click)="handleOk()" [nzLoading]="isLoading">确定</button>
<button nz-button [nzType]="'default'" (click)="handleCancel()">取消</button>

</ng-template>
</nz-modal>
ts里得内容:
public isShow = false;
public isLoading = false;
// 取消
public handleCancel() {

this.isShow = false;

}
// 确定
public handleOk() {

this.isLoading = true;this.param['name'] = this.inputValuethis.roleManagementService.addModifyDepartment(this.param).subscribe((res: any) => {  if (res.status === 0) {
     console.log(res.data)
  } else {
      console.log(res.data)
  }  this.isLoading = false;  this.isShow = false;
});

}


隔江千里
浏览 1143回答 1
1回答
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答