Toast pt demo added

pull/3913/head
Tuğçe Küçükoğlu 2023-04-28 16:41:43 +03:00
parent 3cc6a25527
commit f6b5ca26ab
4 changed files with 133 additions and 2 deletions

80
doc/toast/pt/PTDoc.vue Normal file
View File

@ -0,0 +1,80 @@
<template>
<DocSectionText v-bind="$attrs"></DocSectionText>
<div class="card flex justify-content-center">
<Toast
group="pt"
:pt="{
container: { class: 'bg-yellow-100' }
}"
/>
<Button label="Show" @click="show()" />
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
code: {
basic: `
<Toast
group="pt"
:pt="{
container: { class: 'bg-yellow-100' }
}"
/>
<Button label="Show" @click="show()" />`,
options: `
<template>
<div class="card flex justify-content-center">
<Toast
group="pt"
:pt="{
container: { class: 'bg-yellow-100' }
}"
/>
<Button label="Show" @click="show()" />
</div>
</template>
<script>
export default {
methods: {
show() {
this.$toast.add({ severity: 'info', summary: 'Info', detail: 'Message Content', group: 'pt', life: 3000 });
}
}
};
<\/script>`,
composition: `
<template>
<div class="card flex justify-content-center">
<Toast
group="pt"
:pt="{
container: { class: 'bg-yellow-100' }
}"
/>
<Button label="Show" @click="show()" />
</div>
</template>
<script setup>
import { useToast } from "primevue/usetoast";
const toast = useToast();
const show = () => {
toast.add({ severity: 'info', summary: 'Info', detail: 'Message Content', group: 'pt', life: 3000 });
};
<\/script>`
}
};
},
methods: {
show() {
this.$toast.add({ severity: 'info', summary: 'Info', detail: 'Message Content', group: 'pt', life: 3000 });
}
}
};
</script>

8
doc/toast/pt/PTImage.vue Normal file
View File

@ -0,0 +1,8 @@
<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/wireframe-placeholder.jpg" />
</div>
</template>

41
doc/toast/pt/index.vue Normal file
View File

@ -0,0 +1,41 @@
<template>
<div class="doc-main">
<div class="doc-intro">
<h1>Toast Pass Through</h1>
</div>
<DocSections :docs="docs" />
</div>
<DocSectionNav :docs="docs" />
</template>
<script>
import DocApiTable from '@/components/doc/DocApiTable.vue';
import { getPTOption } from '@/components/doc/helpers/PTHelper.js';
import PtDoc from './PTDoc.vue';
import PTImage from './PTImage.vue';
export default {
data() {
return {
docs: [
{
id: 'pt.image',
label: 'Wireframe',
component: PTImage
},
{
id: 'pt.doc.toast',
label: 'Toast PT Options',
component: DocApiTable,
data: getPTOption('Toast')
},
{
id: 'pt.demo',
label: 'Demo',
component: PtDoc
}
]
};
}
};
</script>

View File

@ -1,5 +1,5 @@
<template>
<DocComponent title="Vue Toast Component" header="Toast" description="Toast is used to display messages in an overlay." :componentDocs="docs" :apiDocs="['Toast', 'ToastService-UseToast']" />
<DocComponent title="Vue Toast Component" header="Toast" description="Toast is used to display messages in an overlay." :componentDocs="docs" :apiDocs="['Toast', 'ToastService-UseToast']" :ptTabComponent="ptComponent" />
</template>
<script>
@ -13,6 +13,7 @@ import StickyDoc from '@/doc/toast/StickyDoc.vue';
import StyleDoc from '@/doc/toast/StyleDoc.vue';
import TemplateDoc from '@/doc/toast/TemplateDoc.vue';
import ToastServiceDoc from '@/doc/toast/ToastServiceDoc.vue';
import PTComponent from '@/doc/toast/pt/index.vue';
export default {
data() {
@ -68,7 +69,8 @@ export default {
label: 'Accessibility',
component: AccessibilityDoc
}
]
],
ptComponent: PTComponent
};
}
};