我想在表格中确认删除行但不在Angular中使用确认默认值。
答案 0 :(得分:0)
我建议您使用primeng confirm Dialogue box
html(使用p-confirbox指令)
<p-confirmDialog header="Confirmation" icon="fa fa-question-circle" width="425"></p-confirmDialog>
<button type="text" (click)="confirm()" pButton icon="fa-check" label="Confirm"></button>
在您的组件中导入primeng并通过以下方式调用确认框
import {ConfirmDialogModule,ConfirmationService} from 'primeng/primeng';
export class ConfirmDialogDemo {
constructor(private confirmationService: ConfirmationService) {}
confirm() {
this.confirmationService.confirm({
message: 'Are you sure that you want to perform this action?',
accept: () => {
//Actual logic to perform a confirmation
}
});
}
}