From b80dd2c4f6665c36b0003a878db830f56787c3ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Tue, 2 Nov 2021 12:56:00 +0300 Subject: [PATCH] update confirmpopup demos --- src/views/confirmpopup/ConfirmPopupDemo.vue | 28 ++++++ src/views/confirmpopup/ConfirmPopupDoc.vue | 105 +++++++++++++++++++- 2 files changed, 131 insertions(+), 2 deletions(-) diff --git a/src/views/confirmpopup/ConfirmPopupDemo.vue b/src/views/confirmpopup/ConfirmPopupDemo.vue index b7ceb1c17..d1aa64c1a 100644 --- a/src/views/confirmpopup/ConfirmPopupDemo.vue +++ b/src/views/confirmpopup/ConfirmPopupDemo.vue @@ -10,10 +10,22 @@
+ + +
+
Overlay
+ +
Templating
+
@@ -52,6 +64,22 @@ export default { this.$toast.add({severity:'error', summary:'Rejected', detail:'You have rejected', life: 3000}); } }); + }, + showTemplate(event) { + this.$confirm.require({ + target: event.currentTarget, + group: 'demo', + message: 'Do you accept that?', + icon: 'pi pi-question-circle', + acceptIcon: 'pi pi-check', + rejectIcon: 'pi pi-times', + accept: () => { + this.$toast.add({severity:'info', summary:'Confirmed', detail:'You have accepted', life: 3000}); + }, + reject: () => { + this.$toast.add({severity:'error', summary:'Rejected', detail:'You have rejected', life: 3000}); + } + }); } }, components: { diff --git a/src/views/confirmpopup/ConfirmPopupDoc.vue b/src/views/confirmpopup/ConfirmPopupDoc.vue index 1e919ed31..6580e7b85 100644 --- a/src/views/confirmpopup/ConfirmPopupDoc.vue +++ b/src/views/confirmpopup/ConfirmPopupDoc.vue @@ -95,6 +95,21 @@ export default { } } + + +
Templating
+

Templating allows customizing the content where the message instance is available as the implicit variable.

+

 
Confirmation Options
@@ -278,11 +293,23 @@ export default { @@ -316,6 +343,22 @@ export default { this.$toast.add({severity:'error', summary:'Rejected', detail:'You have rejected', life: 3000}); } }); + }, + showTemplate(event) { + this.$confirm.require({ + target: event.currentTarget, + group: 'demo', + message: 'Do you accept that?', + icon: 'pi pi-question-circle', + acceptIcon: 'pi pi-check', + rejectIcon: 'pi pi-times', + accept: () => { + this.$toast.add({severity:'info', summary:'Confirmed', detail:'You have accepted', life: 3000}); + }, + reject: () => { + this.$toast.add({severity:'error', summary:'Rejected', detail:'You have rejected', life: 3000}); + } + }); } } } @@ -327,11 +370,23 @@ export default { content: ` @@ -375,7 +430,24 @@ export default defineComponent({ }); } - return { confirm1, confirm2 }; + const showTemplate = (event) => { + confirm.require({ + target: event.currentTarget, + group: 'demo', + message: 'Do you accept that?', + icon: 'pi pi-question-circle', + acceptIcon: 'pi pi-check', + rejectIcon: 'pi pi-times', + accept: () => { + toast.add({severity:'info', summary:'Confirmed', detail:'You have accepted', life: 3000}); + }, + reject: () => { + toast.add({severity:'error', summary:'Rejected', detail:'You have rejected', life: 3000}); + } + }); + } + + return { confirm1, confirm2, showTemplate }; }, }) <\\/script> @@ -389,11 +461,23 @@ export default defineComponent({