diff --git a/components/lib/megamenu/style/MegaMenuStyle.js b/components/lib/megamenu/style/MegaMenuStyle.js
index 0309512df..9e6353c14 100644
--- a/components/lib/megamenu/style/MegaMenuStyle.js
+++ b/components/lib/megamenu/style/MegaMenuStyle.js
@@ -4,6 +4,7 @@ const css = `
@layer primevue {
.p-megamenu {
display: flex;
+ position: relative;
}
.p-megamenu-root-list {
@@ -12,10 +13,6 @@ const css = `
list-style: none;
}
- .p-megamenu-root-list > .p-menuitem {
- position: relative;
- }
-
.p-megamenu .p-menuitem-link {
cursor: pointer;
display: flex;
@@ -34,6 +31,8 @@ const css = `
position: absolute;
width: auto;
z-index: 1;
+ left: 0;
+ min-width: 100%;
}
.p-megamenu-root-list > .p-menuitem-active > .p-megamenu-panel {
diff --git a/doc/megamenu/BasicDoc.vue b/doc/megamenu/BasicDoc.vue
index 09057c042..1049c0677 100644
--- a/doc/megamenu/BasicDoc.vue
+++ b/doc/megamenu/BasicDoc.vue
@@ -2,7 +2,7 @@
MegaMenu requires a collection of menuitems as its model.
-
+
@@ -14,115 +14,95 @@ export default {
return {
items: [
{
- label: 'Videos',
- icon: 'pi pi-fw pi-video',
+ label: 'Furniture',
+ icon: 'pi pi-box',
items: [
[
{
- label: 'Video 1',
- items: [{ label: 'Video 1.1' }, { label: 'Video 1.2' }]
- },
- {
- label: 'Video 2',
- items: [{ label: 'Video 2.1' }, { label: 'Video 2.2' }]
+ label: 'Living Room',
+ items: [{ label: 'Accessories' }, { label: 'Armchair' }, { label: 'Coffee Table' }, { label: 'Couch' }, { label: 'TV Stand' }]
}
],
[
{
- label: 'Video 3',
- items: [{ label: 'Video 3.1' }, { label: 'Video 3.2' }]
+ label: 'Kitchen',
+ items: [{ label: 'Bar stool' }, { label: 'Chair' }, { label: 'Table' }]
},
{
- label: 'Video 4',
- items: [{ label: 'Video 4.1' }, { label: 'Video 4.2' }]
+ label: 'Bathroom',
+ items: [{ label: 'Accessories' }]
+ }
+ ],
+ [
+ {
+ label: 'Bedroom',
+ items: [{ label: 'Bed' }, { label: 'Chaise lounge' }, { label: 'Cupboard' }, { label: 'Dresser' }, { label: 'Wardrobe' }]
+ }
+ ],
+ [
+ {
+ label: 'Office',
+ items: [{ label: 'Bookcase' }, { label: 'Cabinet' }, { label: 'Chair' }, { label: 'Desk' }, { label: 'Executive Chair' }]
}
]
]
},
{
- label: 'Users',
- icon: 'pi pi-fw pi-users',
+ label: 'Electronics',
+ icon: 'pi pi-mobile',
items: [
[
{
- label: 'User 1',
- items: [{ label: 'User 1.1' }, { label: 'User 1.2' }]
- },
- {
- label: 'User 2',
- items: [{ label: 'User 2.1' }, { label: 'User 2.2' }]
+ label: 'Computer',
+ items: [{ label: 'Monitor' }, { label: 'Mouse' }, { label: 'Notebook' }, { label: 'Keyboard' }, { label: 'Printer' }, { label: 'Storage' }]
}
],
[
{
- label: 'User 3',
- items: [{ label: 'User 3.1' }, { label: 'User 3.2' }]
- },
- {
- label: 'User 4',
- items: [{ label: 'User 4.1' }, { label: 'User 4.2' }]
+ label: 'Home Theather',
+ items: [{ label: 'Projector' }, { label: 'Speakers' }, { label: 'TVs' }]
}
],
[
{
- label: 'User 5',
- items: [{ label: 'User 5.1' }, { label: 'User 5.2' }]
- },
+ label: 'Gaming',
+ items: [{ label: 'Accessories' }, { label: 'Console' }, { label: 'PC' }, { label: 'Video Games' }]
+ }
+ ],
+ [
{
- label: 'User 6',
- items: [{ label: 'User 6.1' }, { label: 'User 6.2' }]
+ label: 'Appliances',
+ items: [{ label: 'Coffee Machine' }, { label: 'Fridge' }, { label: 'Oven' }, { label: 'Vaccum Cleaner' }, { label: 'Washing Machine' }]
}
]
]
},
{
- label: 'Events',
- icon: 'pi pi-fw pi-calendar',
+ label: 'Sports',
+ icon: 'pi pi-clock',
items: [
[
{
- label: 'Event 1',
- items: [{ label: 'Event 1.1' }, { label: 'Event 1.2' }]
- },
- {
- label: 'Event 2',
- items: [{ label: 'Event 2.1' }, { label: 'Event 2.2' }]
+ label: 'Football',
+ items: [{ label: 'Kits' }, { label: 'Shoes' }, { label: 'Shorts' }, { label: 'Training' }]
}
],
[
{
- label: 'Event 3',
- items: [{ label: 'Event 3.1' }, { label: 'Event 3.2' }]
- },
- {
- label: 'Event 4',
- items: [{ label: 'Event 4.1' }, { label: 'Event 4.2' }]
- }
- ]
- ]
- },
- {
- label: 'Settings',
- icon: 'pi pi-fw pi-cog',
- items: [
- [
- {
- label: 'Setting 1',
- items: [{ label: 'Setting 1.1' }, { label: 'Setting 1.2' }]
- },
- {
- label: 'Setting 2',
- items: [{ label: 'Setting 2.1' }, { label: 'Setting 2.2' }]
- },
- {
- label: 'Setting 3',
- items: [{ label: 'Setting 3.1' }, { label: 'Setting 3.2' }]
+ label: 'Running',
+ items: [{ label: 'Accessories' }, { label: 'Shoes' }, { label: 'T-Shirts' }, { label: 'Shorts' }]
}
],
[
{
- label: 'Technology 4',
- items: [{ label: 'Setting 4.1' }, { label: 'Setting 4.2' }]
+ label: 'Swimming',
+ items: [{ label: 'Kickboard' }, { label: 'Nose Clip' }, { label: 'Swimsuits' }, { label: 'Paddles' }]
+ }
+ ],
+ [
+ {
+ label: 'Tennis',
+ items: [{ label: 'Balls' }, { label: 'Rackets' }, { label: 'Shoes' }, { label: 'Training' }]
}
]
]
@@ -145,115 +125,95 @@ export default {
return {
items: [
{
- label: 'Videos',
- icon: 'pi pi-fw pi-video',
+ label: 'Furniture',
+ icon: 'pi pi-box',
items: [
[
{
- label: 'Video 1',
- items: [{ label: 'Video 1.1' }, { label: 'Video 1.2' }]
- },
- {
- label: 'Video 2',
- items: [{ label: 'Video 2.1' }, { label: 'Video 2.2' }]
+ label: 'Living Room',
+ items: [{ label: 'Accessories' }, { label: 'Armchair' }, { label: 'Coffee Table' }, { label: 'Couch' }, { label: 'TV Stand' }]
}
],
[
{
- label: 'Video 3',
- items: [{ label: 'Video 3.1' }, { label: 'Video 3.2' }]
+ label: 'Kitchen',
+ items: [{ label: 'Bar stool' }, { label: 'Chair' }, { label: 'Table' }]
},
{
- label: 'Video 4',
- items: [{ label: 'Video 4.1' }, { label: 'Video 4.2' }]
+ label: 'Bathroom',
+ items: [{ label: 'Accessories' }]
+ }
+ ],
+ [
+ {
+ label: 'Bedroom',
+ items: [{ label: 'Bed' }, { label: 'Chaise lounge' }, { label: 'Cupboard' }, { label: 'Dresser' }, { label: 'Wardrobe' }]
+ }
+ ],
+ [
+ {
+ label: 'Office',
+ items: [{ label: 'Bookcase' }, { label: 'Cabinet' }, { label: 'Chair' }, { label: 'Desk' }, { label: 'Executive Chair' }]
}
]
]
},
{
- label: 'Users',
- icon: 'pi pi-fw pi-users',
+ label: 'Electronics',
+ icon: 'pi pi-mobile',
items: [
[
{
- label: 'User 1',
- items: [{ label: 'User 1.1' }, { label: 'User 1.2' }]
- },
- {
- label: 'User 2',
- items: [{ label: 'User 2.1' }, { label: 'User 2.2' }]
+ label: 'Computer',
+ items: [{ label: 'Monitor' }, { label: 'Mouse' }, { label: 'Notebook' }, { label: 'Keyboard' }, { label: 'Printer' }, { label: 'Storage' }]
}
],
[
{
- label: 'User 3',
- items: [{ label: 'User 3.1' }, { label: 'User 3.2' }]
- },
- {
- label: 'User 4',
- items: [{ label: 'User 4.1' }, { label: 'User 4.2' }]
+ label: 'Home Theather',
+ items: [{ label: 'Projector' }, { label: 'Speakers' }, { label: 'TVs' }]
}
],
[
{
- label: 'User 5',
- items: [{ label: 'User 5.1' }, { label: 'User 5.2' }]
- },
+ label: 'Gaming',
+ items: [{ label: 'Accessories' }, { label: 'Console' }, { label: 'PC' }, { label: 'Video Games' }]
+ }
+ ],
+ [
{
- label: 'User 6',
- items: [{ label: 'User 6.1' }, { label: 'User 6.2' }]
+ label: 'Appliances',
+ items: [{ label: 'Coffee Machine' }, { label: 'Fridge' }, { label: 'Oven' }, { label: 'Vaccum Cleaner' }, { label: 'Washing Machine' }]
}
]
]
},
{
- label: 'Events',
- icon: 'pi pi-fw pi-calendar',
+ label: 'Sports',
+ icon: 'pi pi-clock',
items: [
[
{
- label: 'Event 1',
- items: [{ label: 'Event 1.1' }, { label: 'Event 1.2' }]
- },
- {
- label: 'Event 2',
- items: [{ label: 'Event 2.1' }, { label: 'Event 2.2' }]
+ label: 'Football',
+ items: [{ label: 'Kits' }, { label: 'Shoes' }, { label: 'Shorts' }, { label: 'Training' }]
}
],
[
{
- label: 'Event 3',
- items: [{ label: 'Event 3.1' }, { label: 'Event 3.2' }]
- },
- {
- label: 'Event 4',
- items: [{ label: 'Event 4.1' }, { label: 'Event 4.2' }]
- }
- ]
- ]
- },
- {
- label: 'Settings',
- icon: 'pi pi-fw pi-cog',
- items: [
- [
- {
- label: 'Setting 1',
- items: [{ label: 'Setting 1.1' }, { label: 'Setting 1.2' }]
- },
- {
- label: 'Setting 2',
- items: [{ label: 'Setting 2.1' }, { label: 'Setting 2.2' }]
- },
- {
- label: 'Setting 3',
- items: [{ label: 'Setting 3.1' }, { label: 'Setting 3.2' }]
+ label: 'Running',
+ items: [{ label: 'Accessories' }, { label: 'Shoes' }, { label: 'T-Shirts' }, { label: 'Shorts' }]
}
],
[
{
- label: 'Technology 4',
- items: [{ label: 'Setting 4.1' }, { label: 'Setting 4.2' }]
+ label: 'Swimming',
+ items: [{ label: 'Kickboard' }, { label: 'Nose Clip' }, { label: 'Swimsuits' }, { label: 'Paddles' }]
+ }
+ ],
+ [
+ {
+ label: 'Tennis',
+ items: [{ label: 'Balls' }, { label: 'Rackets' }, { label: 'Shoes' }, { label: 'Training' }]
}
]
]
@@ -276,115 +236,95 @@ import { ref } from "vue";
const items = ref([
{
- label: 'Videos',
- icon: 'pi pi-fw pi-video',
+ label: 'Furniture',
+ icon: 'pi pi-box',
items: [
[
{
- label: 'Video 1',
- items: [{ label: 'Video 1.1' }, { label: 'Video 1.2' }]
- },
- {
- label: 'Video 2',
- items: [{ label: 'Video 2.1' }, { label: 'Video 2.2' }]
+ label: 'Living Room',
+ items: [{ label: 'Accessories' }, { label: 'Armchair' }, { label: 'Coffee Table' }, { label: 'Couch' }, { label: 'TV Stand' }]
}
],
[
{
- label: 'Video 3',
- items: [{ label: 'Video 3.1' }, { label: 'Video 3.2' }]
+ label: 'Kitchen',
+ items: [{ label: 'Bar stool' }, { label: 'Chair' }, { label: 'Table' }]
},
{
- label: 'Video 4',
- items: [{ label: 'Video 4.1' }, { label: 'Video 4.2' }]
+ label: 'Bathroom',
+ items: [{ label: 'Accessories' }]
+ }
+ ],
+ [
+ {
+ label: 'Bedroom',
+ items: [{ label: 'Bed' }, { label: 'Chaise lounge' }, { label: 'Cupboard' }, { label: 'Dresser' }, { label: 'Wardrobe' }]
+ }
+ ],
+ [
+ {
+ label: 'Office',
+ items: [{ label: 'Bookcase' }, { label: 'Cabinet' }, { label: 'Chair' }, { label: 'Desk' }, { label: 'Executive Chair' }]
}
]
]
},
{
- label: 'Users',
- icon: 'pi pi-fw pi-users',
+ label: 'Electronics',
+ icon: 'pi pi-mobile',
items: [
[
{
- label: 'User 1',
- items: [{ label: 'User 1.1' }, { label: 'User 1.2' }]
- },
- {
- label: 'User 2',
- items: [{ label: 'User 2.1' }, { label: 'User 2.2' }]
+ label: 'Computer',
+ items: [{ label: 'Monitor' }, { label: 'Mouse' }, { label: 'Notebook' }, { label: 'Keyboard' }, { label: 'Printer' }, { label: 'Storage' }]
}
],
[
{
- label: 'User 3',
- items: [{ label: 'User 3.1' }, { label: 'User 3.2' }]
- },
- {
- label: 'User 4',
- items: [{ label: 'User 4.1' }, { label: 'User 4.2' }]
+ label: 'Home Theather',
+ items: [{ label: 'Projector' }, { label: 'Speakers' }, { label: 'TVs' }]
}
],
[
{
- label: 'User 5',
- items: [{ label: 'User 5.1' }, { label: 'User 5.2' }]
- },
+ label: 'Gaming',
+ items: [{ label: 'Accessories' }, { label: 'Console' }, { label: 'PC' }, { label: 'Video Games' }]
+ }
+ ],
+ [
{
- label: 'User 6',
- items: [{ label: 'User 6.1' }, { label: 'User 6.2' }]
+ label: 'Appliances',
+ items: [{ label: 'Coffee Machine' }, { label: 'Fridge' }, { label: 'Oven' }, { label: 'Vaccum Cleaner' }, { label: 'Washing Machine' }]
}
]
]
},
{
- label: 'Events',
- icon: 'pi pi-fw pi-calendar',
+ label: 'Sports',
+ icon: 'pi pi-clock',
items: [
[
{
- label: 'Event 1',
- items: [{ label: 'Event 1.1' }, { label: 'Event 1.2' }]
- },
- {
- label: 'Event 2',
- items: [{ label: 'Event 2.1' }, { label: 'Event 2.2' }]
+ label: 'Football',
+ items: [{ label: 'Kits' }, { label: 'Shoes' }, { label: 'Shorts' }, { label: 'Training' }]
}
],
[
{
- label: 'Event 3',
- items: [{ label: 'Event 3.1' }, { label: 'Event 3.2' }]
- },
- {
- label: 'Event 4',
- items: [{ label: 'Event 4.1' }, { label: 'Event 4.2' }]
- }
- ]
- ]
- },
- {
- label: 'Settings',
- icon: 'pi pi-fw pi-cog',
- items: [
- [
- {
- label: 'Setting 1',
- items: [{ label: 'Setting 1.1' }, { label: 'Setting 1.2' }]
- },
- {
- label: 'Setting 2',
- items: [{ label: 'Setting 2.1' }, { label: 'Setting 2.2' }]
- },
- {
- label: 'Setting 3',
- items: [{ label: 'Setting 3.1' }, { label: 'Setting 3.2' }]
+ label: 'Running',
+ items: [{ label: 'Accessories' }, { label: 'Shoes' }, { label: 'T-Shirts' }, { label: 'Shorts' }]
}
],
[
{
- label: 'Technology 4',
- items: [{ label: 'Setting 4.1' }, { label: 'Setting 4.2' }]
+ label: 'Swimming',
+ items: [{ label: 'Kickboard' }, { label: 'Nose Clip' }, { label: 'Swimsuits' }, { label: 'Paddles' }]
+ }
+ ],
+ [
+ {
+ label: 'Tennis',
+ items: [{ label: 'Balls' }, { label: 'Rackets' }, { label: 'Shoes' }, { label: 'Training' }]
}
]
]
diff --git a/doc/megamenu/CommandDoc.vue b/doc/megamenu/CommandDoc.vue
new file mode 100644
index 000000000..9d30ee141
--- /dev/null
+++ b/doc/megamenu/CommandDoc.vue
@@ -0,0 +1,26 @@
+
+
+ The command property of a menuitem defines the callback to run when an item is activated by click or a key event.
+
+
+
+
+
diff --git a/doc/megamenu/RouterDoc.vue b/doc/megamenu/RouterDoc.vue
index 204843ce6..8fdc9c94b 100644
--- a/doc/megamenu/RouterDoc.vue
+++ b/doc/megamenu/RouterDoc.vue
@@ -1,169 +1,27 @@
-
- Since v3.33.0 the vue-router dependency of menu components is deprecated and templating should be used to define router links instead. This approach provides flexibility to be able to use any kind of router link component such as
- NuxtLink or router-link. Here is an example with vue-router.
-
+ Items with navigation are defined with templating to be able to use a router link component, an external link or programmatic navigation.
-
-
+