primevue-mirror/apps/showcase/doc/breadcrumb/BasicDoc.vue

76 lines
1.7 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>Breadcrumb requires a collection of menuitems as its <i>model</i>, the root item is defined with the <i>home</i> property.</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" />
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
home: {
2023-11-04 09:58:30 +00:00
icon: 'pi pi-home'
2023-02-28 08:29:30 +00:00
},
2023-11-04 09:58:30 +00:00
items: [{ label: 'Electronics' }, { label: 'Computer' }, { label: 'Accessories' }, { label: 'Keyboard' }, { label: 'Wireless' }],
2023-02-28 08:29:30 +00:00
code: {
2023-09-22 12:54:14 +00:00
basic: `
2023-10-15 09:38:39 +00:00
<Breadcrumb :home="home" :model="items" />
`,
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" />
</div>
</template>
<script>
export default {
data() {
return {
home: {
2023-11-04 09:58:30 +00:00
icon: 'pi pi-home'
2023-02-28 08:29:30 +00:00
},
items: [
2023-11-04 09:58:30 +00:00
{ label: 'Electronics' },
{ label: 'Computer' },
{ label: 'Accessories' },
{ label: 'Keyboard' },
{ label: 'Wireless' }
2023-02-28 08:29:30 +00:00
]
}
}
}
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" />
</div>
</template>
<script setup>
import { ref } from "vue";
const home = ref({
2023-11-04 09:58:30 +00:00
icon: 'pi pi-home'
2023-02-28 08:29:30 +00:00
});
const items = ref([
2023-11-04 09:58:30 +00:00
{ label: 'Electronics' },
{ label: 'Computer' },
{ label: 'Accessories' },
{ label: 'Keyboard' },
{ label: 'Wireless' }
2023-02-28 08:29:30 +00:00
]);
2023-10-15 09:38:39 +00:00
<\/script>
`
2023-02-28 08:29:30 +00:00
}
};
}
};
</script>