2023-02-28 08:29:30 +00:00
|
|
|
<template>
|
|
|
|
<DocSectionText v-bind="$attrs">
|
|
|
|
<p>TieredMenu is inline by default whereas popup mode is supported by enabling <i>popup</i> property and calling toggle method with an event of the target.</p>
|
|
|
|
</DocSectionText>
|
|
|
|
<div class="card flex justify-content-center">
|
|
|
|
<Button type="button" label="Toggle" @click="toggle" aria-haspopup="true" aria-controls="overlay_tmenu" />
|
|
|
|
<TieredMenu ref="menu" id="overlay_tmenu" :model="items" popup />
|
|
|
|
</div>
|
|
|
|
<DocSectionCode :code="code" />
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
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'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
separator: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
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'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2023-10-30 10:43:15 +00:00
|
|
|
label: 'Archive',
|
2023-02-28 08:29:30 +00:00
|
|
|
icon: 'pi pi-fw pi-calendar-times',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Remove',
|
|
|
|
icon: 'pi pi-fw pi-calendar-minus'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
separator: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Quit',
|
|
|
|
icon: 'pi pi-fw pi-power-off'
|
|
|
|
}
|
|
|
|
],
|
|
|
|
code: {
|
2023-09-22 12:54:14 +00:00
|
|
|
basic: `
|
|
|
|
<Button type="button" label="Toggle" @click="toggle" aria-haspopup="true" aria-controls="overlay_tmenu" />
|
2023-10-15 09:38:39 +00:00
|
|
|
<TieredMenu ref="menu" id="overlay_tmenu" :model="items" popup />
|
|
|
|
`,
|
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">
|
|
|
|
<Button type="button" label="Toggle" @click="toggle" aria-haspopup="true" aria-controls="overlay_tmenu" />
|
|
|
|
<TieredMenu ref="menu" id="overlay_tmenu" :model="items" popup />
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
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'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
separator: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
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'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2023-10-30 10:43:15 +00:00
|
|
|
label: 'Archive',
|
2023-02-28 08:29:30 +00:00
|
|
|
icon: 'pi pi-fw pi-calendar-times',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Remove',
|
|
|
|
icon: 'pi pi-fw pi-calendar-minus'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
separator: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Quit',
|
|
|
|
icon: 'pi pi-fw pi-power-off'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
toggle(event) {
|
|
|
|
this.$refs.menu.toggle(event);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
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">
|
|
|
|
<Button type="button" label="Toggle" @click="toggle" aria-haspopup="true" aria-controls="overlay_tmenu" />
|
|
|
|
<TieredMenu ref="menu" id="overlay_tmenu" :model="items" popup />
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
import { ref } from "vue";
|
|
|
|
|
|
|
|
const menu = ref();
|
|
|
|
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'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
separator: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
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'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2023-10-30 10:43:15 +00:00
|
|
|
label: 'Archive',
|
2023-02-28 08:29:30 +00:00
|
|
|
icon: 'pi pi-fw pi-calendar-times',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Remove',
|
|
|
|
icon: 'pi pi-fw pi-calendar-minus'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
separator: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Quit',
|
|
|
|
icon: 'pi pi-fw pi-power-off'
|
|
|
|
}
|
|
|
|
]);
|
|
|
|
|
|
|
|
const toggle = (event) => {
|
|
|
|
menu.value.toggle(event);
|
|
|
|
};
|
2023-10-15 09:38:39 +00:00
|
|
|
<\/script>
|
|
|
|
`
|
2023-02-28 08:29:30 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
toggle(event) {
|
|
|
|
this.$refs.menu.toggle(event);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|