Breadcrumb pt demo added

pull/3913/head
Tuğçe Küçükoğlu 2023-04-27 17:12:22 +03:00
parent d0c9e26cf4
commit bd0152fdef
4 changed files with 157 additions and 2 deletions

104
doc/breadcrumb/pt/PTDoc.vue Normal file
View File

@ -0,0 +1,104 @@
<template>
<DocSectionText v-bind="$attrs"> </DocSectionText>
<div class="card flex justify-content-center">
<Breadcrumb
:home="home"
:model="items"
:pt="{
root: { class: 'surface-ground' },
label: ({ props }) => ({
class: props.index === items.length - 1 ? 'font-italic' : undefined
})
}"
/>
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
home: {
icon: 'pi pi-home',
to: '/'
},
items: [{ label: 'Computer' }, { label: 'Notebook' }, { label: 'Accessories' }, { label: 'Backpacks' }, { label: 'Item' }],
code: {
basic: `
<Breadcrumb :home="home" :model="items"
:pt="{
root: { class: 'surface-ground' },
label: ({ props }) => ({
class: props.index === items.length - 1 ? 'font-italic' : undefined
})
}"
/>`,
options: `
<template>
<div class="card flex justify-content-center">
<Breadcrumb :home="home" :model="items"
:pt="{
root: { class: 'surface-ground' },
label: ({ props }) => ({
class: props.index === items.length - 1 ? 'font-italic' : undefined
})
}"
/>
</div>
</template>
<script>
export default {
data() {
return {
home: {
icon: 'pi pi-home',
to: '/',
},
items: [
{label: 'Computer'},
{label: 'Notebook'},
{label: 'Accessories'},
{label: 'Backpacks'},
{label: 'Item'}
]
}
}
}
<\/script>`,
composition: `
<template>
<div class="card flex justify-content-center">
<Breadcrumb :home="home" :model="items"
:pt="{
root: { class: 'surface-ground' },
label: ({ props }) => ({
class: props.index === items.length - 1 ? 'font-italic' : undefined
})
}"
/>
</div>
</template>
<script setup>
import { ref } from "vue";
const home = ref({
icon: 'pi pi-home',
to: '/',
});
const items = ref([
{label: 'Computer'},
{label: 'Notebook'},
{label: 'Accessories'},
{label: 'Backpacks'},
{label: 'Item'}
]);
<\/script>`
}
};
}
};
</script>

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>

View File

@ -0,0 +1,41 @@
<template>
<div class="doc-main">
<div class="doc-intro">
<h1>Breadcrumb 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.breadcrumb',
label: 'Breadcrumb PT Options',
component: DocApiTable,
data: getPTOption('Breadcrumb')
},
{
id: 'pt.demo',
label: 'Demo',
component: PtDoc
}
]
};
}
};
</script>

View File

@ -1,5 +1,5 @@
<template> <template>
<DocComponent title="Vue Breadcrumb Component" header="Breadcrumb" description="Breadcrumb provides contextual information about page hierarchy." :componentDocs="docs" :apiDocs="['Breadcrumb', 'MenuItem']" /> <DocComponent title="Vue Breadcrumb Component" header="Breadcrumb" description="Breadcrumb provides contextual information about page hierarchy." :componentDocs="docs" :apiDocs="['Breadcrumb', 'MenuItem']" :ptTabComponent="ptComponent" />
</template> </template>
<script> <script>
@ -8,6 +8,7 @@ import BasicDoc from '@/doc/breadcrumb/BasicDoc';
import ImportDoc from '@/doc/breadcrumb/ImportDoc'; import ImportDoc from '@/doc/breadcrumb/ImportDoc';
import StyleDoc from '@/doc/breadcrumb/StyleDoc'; import StyleDoc from '@/doc/breadcrumb/StyleDoc';
import TemplateDoc from '@/doc/breadcrumb/TemplateDoc'; import TemplateDoc from '@/doc/breadcrumb/TemplateDoc';
import PTComponent from '@/doc/breadcrumb/pt/index.vue';
export default { export default {
data() { data() {
@ -38,7 +39,8 @@ export default {
label: 'Accessibility', label: 'Accessibility',
component: AccessibilityDoc component: AccessibilityDoc
} }
] ],
ptComponent: PTComponent
}; };
} }
}; };