2019-12-09 06:51:21 +00:00
|
|
|
<template>
|
2021-04-06 09:16:59 +00:00
|
|
|
<AppDoc name="PanelMenuDemo" :sources="sources" github="panelmenu/PanelMenuDemo.vue">
|
2021-03-23 07:47:00 +00:00
|
|
|
<h5>Import</h5>
|
2021-02-03 10:10:30 +00:00
|
|
|
<pre v-code.script><code>
|
2019-12-09 06:51:21 +00:00
|
|
|
import PanelMenu from 'primevue/panelmenu';
|
2020-09-24 11:14:55 +00:00
|
|
|
|
|
|
|
</code></pre>
|
2019-12-09 06:51:21 +00:00
|
|
|
|
2021-03-23 07:47:00 +00:00
|
|
|
<h5>MenuModel</h5>
|
|
|
|
<p>PanelMenu uses the common MenuModel API to define the items, visit <router-link to="/menumodel">MenuModel API</router-link> for details.</p>
|
2019-12-09 06:51:21 +00:00
|
|
|
|
2021-03-23 07:47:00 +00:00
|
|
|
<h5>Getting Started</h5>
|
|
|
|
<p>PanelMenu requires a collection of menuitems as its model.</p>
|
2021-02-03 10:10:30 +00:00
|
|
|
<pre v-code><code>
|
2019-12-09 07:24:56 +00:00
|
|
|
<PanelMenu :model="items" />
|
2019-12-09 06:51:21 +00:00
|
|
|
|
2020-09-24 11:14:55 +00:00
|
|
|
</code></pre>
|
|
|
|
|
2021-02-03 10:10:30 +00:00
|
|
|
<pre v-code.script><code>
|
2019-12-09 06:51:21 +00:00
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
items: [
|
2019-12-09 07:24:56 +00:00
|
|
|
{
|
|
|
|
label: 'File',
|
|
|
|
icon:'pi pi-fw pi-file',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'New',
|
|
|
|
icon:'pi pi-fw pi-plus',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Bookmark',
|
|
|
|
icon:'pi pi-fw pi-bookmark'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Video',
|
|
|
|
icon:'pi pi-fw pi-video'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Delete',
|
|
|
|
icon:'pi pi-fw pi-trash'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Export',
|
|
|
|
icon:'pi pi-fw pi-external-link'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Edit',
|
|
|
|
icon:'pi pi-fw pi-pencil',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Left',
|
|
|
|
icon:'pi pi-fw pi-align-left'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Right',
|
|
|
|
icon:'pi pi-fw pi-align-right'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Center',
|
|
|
|
icon:'pi pi-fw pi-align-center'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Justify',
|
|
|
|
icon:'pi pi-fw pi-align-justify'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Users',
|
|
|
|
icon:'pi pi-fw pi-user',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'New',
|
|
|
|
icon:'pi pi-fw pi-user-plus',
|
2019-12-09 08:34:31 +00:00
|
|
|
|
2019-12-09 07:24:56 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Delete',
|
|
|
|
icon:'pi pi-fw pi-user-minus',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Search',
|
|
|
|
icon:'pi pi-fw pi-users',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Filter',
|
|
|
|
icon:'pi pi-fw pi-filter',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Print',
|
|
|
|
icon:'pi pi-fw pi-print'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
icon:'pi pi-fw pi-bars',
|
|
|
|
label: 'List'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Events',
|
|
|
|
icon:'pi pi-fw pi-calendar',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Edit',
|
|
|
|
icon:'pi pi-fw pi-pencil',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Save',
|
|
|
|
icon:'pi pi-fw pi-calendar-plus'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Delete',
|
|
|
|
icon:'pi pi-fw pi-calendar-minus'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Archieve',
|
|
|
|
icon:'pi pi-fw pi-calendar-times',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Remove',
|
|
|
|
icon:'pi pi-fw pi-calendar-minus'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
2019-12-09 06:51:21 +00:00
|
|
|
}
|
2019-12-09 07:24:56 +00:00
|
|
|
]
|
2019-12-09 06:51:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-09-24 11:14:55 +00:00
|
|
|
|
|
|
|
</code></pre>
|
2019-12-09 06:51:21 +00:00
|
|
|
|
2021-03-23 07:47:00 +00:00
|
|
|
<h5>Properties</h5>
|
|
|
|
<p>Any property as style and class are passed to the main container element. Following are the additional properties to configure the component.</p>
|
|
|
|
<div class="doc-tablewrapper">
|
|
|
|
<table class="doc-table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Type</th>
|
|
|
|
<th>Default</th>
|
|
|
|
<th>Description</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>model</td>
|
|
|
|
<td>array</td>
|
|
|
|
<td>null</td>
|
|
|
|
<td>An array of menuitems.</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
2019-12-09 06:51:21 +00:00
|
|
|
|
2021-03-23 07:47:00 +00:00
|
|
|
<h5>Styling</h5>
|
|
|
|
<p>Following is the list of structural style classes, for theming classes visit <router-link to="/theming">theming</router-link> page.</p>
|
|
|
|
<div class="doc-tablewrapper">
|
|
|
|
<table class="doc-table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Element</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>p-panelmenu</td>
|
|
|
|
<td>Container element.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>p-panelmenu-header</td>
|
|
|
|
<td>Accordion header of root submenu.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>p-panelmenu-content</td>
|
|
|
|
<td>Accordion content of root submenu.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>p-submenu-list</td>
|
|
|
|
<td>List element.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>p-menuitem</td>
|
|
|
|
<td>Menuitem element.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>p-menuitem-text</td>
|
|
|
|
<td>Label of a menuitem.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>p-menuitem-icon</td>
|
|
|
|
<td>Icon of a menuitem.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>p-panelmenu-icon</td>
|
|
|
|
<td>Arrow icon of an accordion header.</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
2019-12-09 06:51:21 +00:00
|
|
|
|
2021-03-23 07:47:00 +00:00
|
|
|
<h5>Dependencies</h5>
|
|
|
|
<p>None.</p>
|
|
|
|
</AppDoc>
|
|
|
|
</template>
|
2019-12-09 06:51:21 +00:00
|
|
|
|
2021-03-23 07:47:00 +00:00
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
sources: {
|
|
|
|
'options-api': {
|
2021-04-05 09:29:28 +00:00
|
|
|
tabName: 'Options API Source',
|
2021-03-23 07:47:00 +00:00
|
|
|
content: `
|
|
|
|
<template>
|
2021-03-24 17:37:09 +00:00
|
|
|
<div>
|
2021-03-23 07:47:00 +00:00
|
|
|
<PanelMenu :model="items" />
|
|
|
|
</div>
|
2019-12-09 06:51:21 +00:00
|
|
|
</template>
|
|
|
|
|
2021-03-23 07:47:00 +00:00
|
|
|
<script>
|
2019-12-09 06:51:21 +00:00
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
items: [
|
|
|
|
{
|
2019-12-09 07:24:56 +00:00
|
|
|
label: 'File',
|
|
|
|
icon:'pi pi-fw pi-file',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'New',
|
|
|
|
icon:'pi pi-fw pi-plus',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Bookmark',
|
|
|
|
icon:'pi pi-fw pi-bookmark'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Video',
|
|
|
|
icon:'pi pi-fw pi-video'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Delete',
|
|
|
|
icon:'pi pi-fw pi-trash'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Export',
|
|
|
|
icon:'pi pi-fw pi-external-link'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2019-12-09 06:51:21 +00:00
|
|
|
{
|
2019-12-09 07:24:56 +00:00
|
|
|
label: 'Edit',
|
|
|
|
icon:'pi pi-fw pi-pencil',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Left',
|
|
|
|
icon:'pi pi-fw pi-align-left'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Right',
|
|
|
|
icon:'pi pi-fw pi-align-right'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Center',
|
|
|
|
icon:'pi pi-fw pi-align-center'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Justify',
|
|
|
|
icon:'pi pi-fw pi-align-justify'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Users',
|
|
|
|
icon:'pi pi-fw pi-user',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'New',
|
|
|
|
icon:'pi pi-fw pi-user-plus',
|
2019-12-09 08:34:31 +00:00
|
|
|
|
2019-12-09 07:24:56 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Delete',
|
|
|
|
icon:'pi pi-fw pi-user-minus',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Search',
|
|
|
|
icon:'pi pi-fw pi-users',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Filter',
|
|
|
|
icon:'pi pi-fw pi-filter',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Print',
|
|
|
|
icon:'pi pi-fw pi-print'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
icon:'pi pi-fw pi-bars',
|
|
|
|
label: 'List'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Events',
|
|
|
|
icon:'pi pi-fw pi-calendar',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Edit',
|
|
|
|
icon:'pi pi-fw pi-pencil',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Save',
|
|
|
|
icon:'pi pi-fw pi-calendar-plus'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Delete',
|
|
|
|
icon:'pi pi-fw pi-calendar-minus'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Archieve',
|
|
|
|
icon:'pi pi-fw pi-calendar-times',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Remove',
|
|
|
|
icon:'pi pi-fw pi-calendar-minus'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
2019-12-09 06:51:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-03-23 07:47:00 +00:00
|
|
|
<\\/script>
|
2020-09-24 11:14:55 +00:00
|
|
|
|
2021-03-23 07:47:00 +00:00
|
|
|
<style scoped lang="scss">
|
|
|
|
.p-panelmenu {
|
|
|
|
width: 22rem;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
`
|
|
|
|
},
|
|
|
|
'composition-api': {
|
2021-04-05 09:29:28 +00:00
|
|
|
tabName: 'Composition API Source',
|
2021-03-23 07:47:00 +00:00
|
|
|
content: `
|
|
|
|
<template>
|
2021-03-24 17:37:09 +00:00
|
|
|
<div>
|
2021-03-23 07:47:00 +00:00
|
|
|
<PanelMenu :model="items" />
|
2021-01-21 08:55:32 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-03-23 07:47:00 +00:00
|
|
|
import { ref } from 'vue';
|
|
|
|
|
2021-01-21 08:55:32 +00:00
|
|
|
export default {
|
2021-03-23 07:47:00 +00:00
|
|
|
setup() {
|
|
|
|
const items = ref([
|
|
|
|
{
|
|
|
|
label: 'File',
|
|
|
|
icon:'pi pi-fw pi-file',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'New',
|
|
|
|
icon:'pi pi-fw pi-plus',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Bookmark',
|
|
|
|
icon:'pi pi-fw pi-bookmark'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Video',
|
|
|
|
icon:'pi pi-fw pi-video'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Delete',
|
|
|
|
icon:'pi pi-fw pi-trash'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Export',
|
|
|
|
icon:'pi pi-fw pi-external-link'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Edit',
|
|
|
|
icon:'pi pi-fw pi-pencil',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Left',
|
|
|
|
icon:'pi pi-fw pi-align-left'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Right',
|
|
|
|
icon:'pi pi-fw pi-align-right'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Center',
|
|
|
|
icon:'pi pi-fw pi-align-center'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Justify',
|
|
|
|
icon:'pi pi-fw pi-align-justify'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Users',
|
|
|
|
icon:'pi pi-fw pi-user',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'New',
|
|
|
|
icon:'pi pi-fw pi-user-plus',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Delete',
|
|
|
|
icon:'pi pi-fw pi-user-minus',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Search',
|
|
|
|
icon:'pi pi-fw pi-users',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Filter',
|
|
|
|
icon:'pi pi-fw pi-filter',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Print',
|
|
|
|
icon:'pi pi-fw pi-print'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
icon:'pi pi-fw pi-bars',
|
|
|
|
label: 'List'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Events',
|
|
|
|
icon:'pi pi-fw pi-calendar',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Edit',
|
|
|
|
icon:'pi pi-fw pi-pencil',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Save',
|
|
|
|
icon:'pi pi-fw pi-calendar-plus'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Delete',
|
|
|
|
icon:'pi pi-fw pi-calendar-minus'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Archieve',
|
|
|
|
icon:'pi pi-fw pi-calendar-times',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Remove',
|
|
|
|
icon:'pi pi-fw pi-calendar-minus'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]);
|
2021-01-21 08:55:32 +00:00
|
|
|
|
2021-03-23 07:47:00 +00:00
|
|
|
return { items }
|
2021-01-21 08:55:32 +00:00
|
|
|
}
|
2021-03-23 07:47:00 +00:00
|
|
|
}
|
|
|
|
<\\/script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
2021-01-21 08:55:32 +00:00
|
|
|
.p-panelmenu {
|
|
|
|
width: 22rem;
|
|
|
|
}
|
2021-03-23 07:47:00 +00:00
|
|
|
</style>
|
|
|
|
`
|
2021-01-21 08:55:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|