primevue-mirror/doc/breadcrumb/TemplateDoc.vue

86 lines
2.6 KiB
Vue
Raw Normal View History

2023-02-28 08:29:30 +00:00
<template>
<DocSectionText v-bind="$attrs">
2023-11-04 09:58:30 +00:00
<p>Custom content can be placed inside the items using the <i>item</i> template. The divider between the items has its own <i>separator</i> template.</p>
2023-02-28 08:29:30 +00:00
</DocSectionText>
2024-05-20 12:14:38 +00:00
<div class="card flex justify-center">
2023-02-28 08:29:30 +00:00
<Breadcrumb :home="home" :model="items">
<template #item="{ item }">
2023-11-04 09:58:30 +00:00
<a class="cursor-pointer" :href="item.url">
2023-02-28 08:29:30 +00:00
<span :class="item.icon"></span>
</a>
</template>
2023-11-04 09:58:30 +00:00
<template #separator> / </template>
2023-02-28 08:29:30 +00:00
</Breadcrumb>
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
2023-11-04 09:58:30 +00:00
home: { icon: 'pi pi-home' },
2023-02-28 08:29:30 +00:00
items: [{ icon: 'pi pi-sitemap' }, { icon: 'pi pi-book' }, { icon: 'pi pi-wallet' }, { icon: 'pi pi-shopping-bag' }, { icon: 'pi pi-calculator' }],
code: {
2023-09-22 12:54:14 +00:00
basic: `
<Breadcrumb :home="home" :model="items">
2024-04-30 17:45:38 +00:00
<template #item="{ item }">
<a class="cursor-pointer" :href="item.url">
<span :class="item.icon"></span>
</a>
2023-02-28 08:29:30 +00:00
</template>
2024-04-30 17:45:38 +00:00
<template #separator> / </template>
2023-10-15 09:38:39 +00:00
</Breadcrumb>
`,
2023-09-22 12:54:14 +00:00
options: `
<template>
2024-05-20 12:14:38 +00:00
<div class="card flex justify-center">
2023-02-28 08:29:30 +00:00
<Breadcrumb :home="home" :model="items">
2023-11-04 09:58:30 +00:00
<template #item="{ item }">
<a class="cursor-pointer" :href="item.url">
2023-02-28 08:29:30 +00:00
<span :class="item.icon"></span>
</a>
</template>
2023-11-04 09:58:30 +00:00
<template #separator> / </template>
2023-02-28 08:29:30 +00:00
</Breadcrumb>
</div>
</template>
<script>
export default {
data() {
return {
2023-11-04 09:58:30 +00:00
home: { icon: 'pi pi-home' },
2023-02-28 08:29:30 +00:00
items: [{ icon: 'pi pi-sitemap' }, { icon: 'pi pi-book' }, { icon: 'pi pi-wallet' }, { icon: 'pi pi-shopping-bag' }, { icon: 'pi pi-calculator' }]
}
}
}
2023-10-15 09:38:39 +00:00
<\/script>
`,
2023-09-22 12:54:14 +00:00
composition: `
<template>
2024-05-20 12:14:38 +00:00
<div class="card flex justify-center">
2023-02-28 08:29:30 +00:00
<Breadcrumb :home="home" :model="items">
2023-11-04 09:58:30 +00:00
<template #item="{ item }">
<a class="cursor-pointer" :href="item.url">
2023-02-28 08:29:30 +00:00
<span :class="item.icon"></span>
</a>
</template>
2023-11-04 09:58:30 +00:00
<template #separator> / </template>
2023-02-28 08:29:30 +00:00
</Breadcrumb>
</div>
</template>
<script setup>
import { ref } from "vue";
2023-11-04 09:58:30 +00:00
const home = ref({ icon: 'pi pi-home' });
2023-02-28 08:29:30 +00:00
const items = ref([{ icon: 'pi pi-sitemap' }, { icon: 'pi pi-book' }, { icon: 'pi pi-wallet' }, { icon: 'pi pi-shopping-bag' }, { icon: 'pi pi-calculator' }]);
2023-10-15 09:38:39 +00:00
<\/script>
`
2023-02-28 08:29:30 +00:00
}
};
}
};
</script>