問題描述現在有三個按鈕,當我點擊一個的時候,另外兩個的disabled要變為不可用,按鈕是下面這些<button nz-button nzType="primary" [disabled]="!validateForm.valid " (click)="getBtnType(1)">保存&關閉</button>
<button nz-button nzType="primary" [disabled]="!validateForm.valid " (click)="getBtnType(2)">保存&繼續</button>
<button nz-button (click)="resetForm($event)">重置</button>寫的有點暈了...
1 回答

千巷貓影
TA貢獻1829條經驗 獲得超7個贊
一個簡單的辦法,如果保存過程中發起 Http 請求,并且使用的是 _HttpClient
則:
<button nz-button nzType="primary" [disabled]="!validateForm.valid || http.loading" (click)="getBtnType(1)">保存&關閉</button><button nz-button nzType="primary" [disabled]="!validateForm.valid || http.loading" (click)="getBtnType(2)">保存&繼續</button><button nz-button [disabled]="http.loading" (click)="resetForm($event)">重置</button>
- 1 回答
- 0 關注
- 542 瀏覽
添加回答
舉報
0/150
提交
取消