2023-02-28 08:29:30 +00:00
|
|
|
<template>
|
|
|
|
<DocSectionText v-bind="$attrs">
|
2023-11-04 08:20:02 +00:00
|
|
|
<p>Menu supports single level of grouping by defining children with the <i>items</i> property.</p>
|
2023-02-28 08:29:30 +00:00
|
|
|
</DocSectionText>
|
|
|
|
<div class="card flex justify-content-center">
|
|
|
|
<Menu :model="items" />
|
|
|
|
</div>
|
|
|
|
<DocSectionCode :code="code" />
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
items: [
|
|
|
|
{
|
2023-11-04 08:20:02 +00:00
|
|
|
label: 'Documents',
|
2023-02-28 08:29:30 +00:00
|
|
|
items: [
|
|
|
|
{
|
2023-11-04 08:20:02 +00:00
|
|
|
label: 'New',
|
|
|
|
icon: 'pi pi-plus'
|
2023-02-28 08:29:30 +00:00
|
|
|
},
|
|
|
|
{
|
2023-11-04 08:20:02 +00:00
|
|
|
label: 'Search',
|
|
|
|
icon: 'pi pi-search'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Profile',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Settings',
|
|
|
|
icon: 'pi pi-cog'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Logout',
|
|
|
|
icon: 'pi pi-sign-out'
|
2023-02-28 08:29:30 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
code: {
|
2023-09-22 12:54:14 +00:00
|
|
|
basic: `
|
|
|
|
<Menu :model="items" />
|
2023-10-15 09:38:39 +00:00
|
|
|
`,
|
2023-09-22 12:54:14 +00:00
|
|
|
options: `
|
|
|
|
<template>
|
2023-02-28 08:29:30 +00:00
|
|
|
<div class="card flex justify-content-center">
|
|
|
|
<Menu :model="items" />
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
items: [
|
|
|
|
{
|
2023-11-04 08:20:02 +00:00
|
|
|
label: 'Documents',
|
2023-02-28 08:29:30 +00:00
|
|
|
items: [
|
|
|
|
{
|
2023-11-04 08:20:02 +00:00
|
|
|
label: 'New',
|
|
|
|
icon: 'pi pi-plus'
|
2023-02-28 08:29:30 +00:00
|
|
|
},
|
|
|
|
{
|
2023-11-04 08:20:02 +00:00
|
|
|
label: 'Search',
|
|
|
|
icon: 'pi pi-search'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Profile',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Settings',
|
|
|
|
icon: 'pi pi-cog'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Logout',
|
|
|
|
icon: 'pi pi-sign-out'
|
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>
|
2023-02-28 08:29:30 +00:00
|
|
|
<div class="card flex justify-content-center">
|
|
|
|
<Menu :model="items" />
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
import { ref } from "vue";
|
|
|
|
|
|
|
|
const items = ref([
|
|
|
|
{
|
2023-11-04 08:20:02 +00:00
|
|
|
label: 'Documents',
|
2023-02-28 08:29:30 +00:00
|
|
|
items: [
|
|
|
|
{
|
2023-11-04 08:20:02 +00:00
|
|
|
label: 'New',
|
|
|
|
icon: 'pi pi-plus'
|
2023-02-28 08:29:30 +00:00
|
|
|
},
|
|
|
|
{
|
2023-11-04 08:20:02 +00:00
|
|
|
label: 'Search',
|
|
|
|
icon: 'pi pi-search'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Profile',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Settings',
|
|
|
|
icon: 'pi pi-cog'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Logout',
|
|
|
|
icon: 'pi pi-sign-out'
|
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>
|