2023-02-28 08:29:30 +00:00
|
|
|
<template>
|
|
|
|
<DocSectionText v-bind="$attrs">
|
2023-10-28 13:59:59 +00:00
|
|
|
<p>Templating allows customizing the message content.</p>
|
2023-02-28 08:29:30 +00:00
|
|
|
</DocSectionText>
|
2023-10-28 13:59:59 +00:00
|
|
|
<ConfirmDialog group="templating">
|
2023-02-28 08:29:30 +00:00
|
|
|
<template #message="slotProps">
|
2023-10-28 13:59:59 +00:00
|
|
|
<div class="flex flex-column align-items-center w-full gap-3 border-bottom-1 surface-border">
|
2023-10-28 18:25:28 +00:00
|
|
|
<i :class="slotProps.message.icon" class="text-6xl text-primary-500"></i>
|
2023-10-28 13:59:59 +00:00
|
|
|
<p>{{ slotProps.message.message }}</p>
|
2023-02-28 08:29:30 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</ConfirmDialog>
|
2023-10-28 13:59:59 +00:00
|
|
|
<div class="card flex justify-content-center">
|
|
|
|
<Button @click="showTemplate()" icon="pi pi-check" label="Confirm"></Button>
|
2023-02-28 08:29:30 +00:00
|
|
|
</div>
|
|
|
|
<DocSectionCode :code="code" />
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
code: {
|
2023-09-22 12:54:14 +00:00
|
|
|
basic: `
|
2023-10-28 13:59:59 +00:00
|
|
|
<ConfirmDialog group="templating">
|
2023-02-28 08:29:30 +00:00
|
|
|
<template #message="slotProps">
|
2023-10-28 13:59:59 +00:00
|
|
|
<div class="flex flex-column align-items-center w-full gap-3 border-bottom-1 surface-border">
|
2023-10-28 18:25:28 +00:00
|
|
|
<i :class="slotProps.message.icon" class="text-6xl text-primary-500"></i>
|
2023-10-28 13:59:59 +00:00
|
|
|
<p>{{ slotProps.message.message }}</p>
|
2023-02-28 08:29:30 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</ConfirmDialog>
|
2023-10-28 13:59:59 +00:00
|
|
|
<Button @click="showTemplate()" icon="pi pi-check" label="Confirm"></Button>
|
2023-10-15 09:38:39 +00:00
|
|
|
`,
|
2023-09-22 12:54:14 +00:00
|
|
|
options: `
|
|
|
|
<template>
|
2023-10-28 13:59:59 +00:00
|
|
|
<ConfirmDialog group="templating">
|
2023-02-28 08:29:30 +00:00
|
|
|
<template #message="slotProps">
|
2023-10-28 13:59:59 +00:00
|
|
|
<div class="flex flex-column align-items-center w-full gap-3 border-bottom-1 surface-border">
|
|
|
|
<i :class="slotProps.message.icon" class="text-5xl text-primary-500"></i>
|
|
|
|
<p>{{ slotProps.message.message }}</p>
|
2023-02-28 08:29:30 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</ConfirmDialog>
|
2023-10-28 13:59:59 +00:00
|
|
|
<div class="card flex justify-content-center">
|
|
|
|
<Button @click="showTemplate()" icon="pi pi-check" label="Confirm"></Button>
|
2023-02-28 08:29:30 +00:00
|
|
|
</div>
|
2023-09-20 08:14:24 +00:00
|
|
|
<Toast />
|
2023-02-28 08:29:30 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
methods: {
|
|
|
|
showTemplate() {
|
|
|
|
this.$confirm.require({
|
|
|
|
group: 'templating',
|
2023-10-28 13:59:59 +00:00
|
|
|
header: 'Confirmation',
|
|
|
|
message: 'Please confirm to proceed moving forward.',
|
2023-10-28 18:25:28 +00:00
|
|
|
icon: 'pi pi-exclamation-circle',
|
2023-02-28 08:29:30 +00:00
|
|
|
acceptIcon: 'pi pi-check',
|
|
|
|
rejectIcon: 'pi pi-times',
|
2023-10-28 18:25:28 +00:00
|
|
|
rejectClass: 'p-button-sm',
|
|
|
|
acceptClass: 'p-button-outlined p-button-sm',
|
2023-02-28 08:29:30 +00:00
|
|
|
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 });
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
2023-10-15 09:38:39 +00:00
|
|
|
<\/script>
|
|
|
|
`,
|
2023-09-22 12:54:14 +00:00
|
|
|
composition: `
|
|
|
|
<template>
|
2023-10-28 13:59:59 +00:00
|
|
|
<ConfirmDialog group="templating">
|
2023-02-28 08:29:30 +00:00
|
|
|
<template #message="slotProps">
|
2023-10-28 13:59:59 +00:00
|
|
|
<div class="flex flex-column align-items-center w-full gap-3 border-bottom-1 surface-border">
|
2023-10-28 18:25:28 +00:00
|
|
|
<i :class="slotProps.message.icon" class="text-6xl text-primary-500"></i>
|
2023-10-28 13:59:59 +00:00
|
|
|
<p>{{ slotProps.message.message }}</p>
|
2023-02-28 08:29:30 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</ConfirmDialog>
|
2023-10-28 13:59:59 +00:00
|
|
|
<div class="card flex justify-content-center">
|
|
|
|
<Button @click="showTemplate()" icon="pi pi-check" label="Confirm"></Button>
|
2023-02-28 08:29:30 +00:00
|
|
|
</div>
|
2023-09-20 08:14:24 +00:00
|
|
|
<Toast />
|
2023-02-28 08:29:30 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
import { useConfirm } from "primevue/useconfirm";
|
|
|
|
import { useToast } from "primevue/usetoast";
|
|
|
|
|
|
|
|
const confirm = useConfirm();
|
|
|
|
const toast = useToast();
|
|
|
|
|
|
|
|
const showTemplate = () => {
|
|
|
|
confirm.require({
|
|
|
|
group: 'templating',
|
2023-10-28 13:59:59 +00:00
|
|
|
header: 'Confirmation',
|
|
|
|
message: 'Please confirm to proceed moving forward.',
|
2023-10-28 18:25:28 +00:00
|
|
|
icon: 'pi pi-exclamation-circle',
|
2023-02-28 08:29:30 +00:00
|
|
|
acceptIcon: 'pi pi-check',
|
|
|
|
rejectIcon: 'pi pi-times',
|
2023-10-28 18:25:28 +00:00
|
|
|
rejectClass: 'p-button-sm',
|
|
|
|
acceptClass: 'p-button-outlined p-button-sm',
|
2023-02-28 08:29:30 +00:00
|
|
|
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 });
|
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|
2023-10-15 09:38:39 +00:00
|
|
|
<\/script>
|
|
|
|
`
|
2023-02-28 08:29:30 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
showTemplate() {
|
|
|
|
this.$confirm.require({
|
|
|
|
group: 'templating',
|
2023-10-28 13:59:59 +00:00
|
|
|
header: 'Confirmation',
|
|
|
|
message: 'Please confirm to proceed moving forward.',
|
2023-10-28 18:25:28 +00:00
|
|
|
icon: 'pi pi-exclamation-circle',
|
2023-02-28 08:29:30 +00:00
|
|
|
acceptIcon: 'pi pi-check',
|
|
|
|
rejectIcon: 'pi pi-times',
|
2023-10-28 18:25:28 +00:00
|
|
|
rejectClass: 'p-button-sm',
|
|
|
|
acceptClass: 'p-button-outlined p-button-sm',
|
2023-02-28 08:29:30 +00:00
|
|
|
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 });
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|