ConfirmDialog ptviewer added

pull/6462/head
tugcekucukoglu 2024-09-23 09:50:55 +03:00
parent cd98059396
commit d4c21053ec
3 changed files with 50 additions and 12 deletions

View File

@ -1,8 +0,0 @@
<template>
<DocSectionText v-bind="$attrs">
<p>{{ $attrs.description }}</p>
</DocSectionText>
<div class="card">
<img class="w-full" src="https://primefaces.org/cdn/primevue/images/pt/confirmdialog.jpg" />
</div>
</template>

View File

@ -0,0 +1,46 @@
<template>
<DocPTViewer :docs="docs">
<ConfirmDialog group="ptviewer" pt:mask="!relative" class="!my-auto"></ConfirmDialog>
</DocPTViewer>
</template>
<script>
import { getPTOptions } from '@/components/doc/helpers';
export default {
data() {
return {
docs: [
{
data: getPTOptions('ConfirmDialog'),
key: 'ConfirmDialog'
}
]
};
},
mounted() {
this.$confirm.require({
group: 'ptviewer',
appendTo: '#doc-ptviewer',
modal: false,
message: 'Are you sure you want to proceed?',
header: 'Confirmation',
icon: 'pi pi-exclamation-triangle',
rejectProps: {
label: 'Cancel',
severity: 'secondary',
outlined: true
},
acceptProps: {
label: 'Save'
},
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>

View File

@ -11,16 +11,16 @@
<script> <script>
import DocApiTable from '@/components/doc/DocApiTable.vue'; import DocApiTable from '@/components/doc/DocApiTable.vue';
import { getPTOptions } from '@/components/doc/helpers'; import { getPTOptions } from '@/components/doc/helpers';
import PTImage from './PTImage.vue'; import PTViewer from './PTViewer.vue';
export default { export default {
data() { data() {
return { return {
docs: [ docs: [
{ {
id: 'pt.image', id: 'pt.viewer',
label: 'Wireframe', label: 'Viewer',
component: PTImage component: PTViewer
}, },
{ {
id: 'pt.doc.confirmdialog', id: 'pt.doc.confirmdialog',