primevue-mirror/doc/megamenu/BasicDoc.vue

340 lines
12 KiB
Vue
Raw Normal View History

2023-02-28 08:29:30 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>MegaMenu requires a collection of menuitems as its <i>model</i>.</p>
</DocSectionText>
2024-05-20 12:14:38 +00:00
<div class="card lg:px-20">
2023-02-28 08:29:30 +00:00
<MegaMenu :model="items" />
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
items: [
{
2023-11-08 18:16:31 +00:00
label: 'Furniture',
icon: 'pi pi-box',
2023-02-28 08:29:30 +00:00
items: [
[
{
2023-11-08 18:16:31 +00:00
label: 'Living Room',
items: [{ label: 'Accessories' }, { label: 'Armchair' }, { label: 'Coffee Table' }, { label: 'Couch' }, { label: 'TV Stand' }]
}
],
[
{
label: 'Kitchen',
items: [{ label: 'Bar stool' }, { label: 'Chair' }, { label: 'Table' }]
2023-02-28 08:29:30 +00:00
},
{
2023-11-08 18:16:31 +00:00
label: 'Bathroom',
items: [{ label: 'Accessories' }]
2023-02-28 08:29:30 +00:00
}
],
[
{
2023-11-08 18:16:31 +00:00
label: 'Bedroom',
items: [{ label: 'Bed' }, { label: 'Chaise lounge' }, { label: 'Cupboard' }, { label: 'Dresser' }, { label: 'Wardrobe' }]
}
],
[
2023-02-28 08:29:30 +00:00
{
2023-11-08 18:16:31 +00:00
label: 'Office',
items: [{ label: 'Bookcase' }, { label: 'Cabinet' }, { label: 'Chair' }, { label: 'Desk' }, { label: 'Executive Chair' }]
2023-02-28 08:29:30 +00:00
}
]
]
},
{
2023-11-08 18:16:31 +00:00
label: 'Electronics',
icon: 'pi pi-mobile',
2023-02-28 08:29:30 +00:00
items: [
[
{
2023-11-08 18:16:31 +00:00
label: 'Computer',
items: [{ label: 'Monitor' }, { label: 'Mouse' }, { label: 'Notebook' }, { label: 'Keyboard' }, { label: 'Printer' }, { label: 'Storage' }]
2023-02-28 08:29:30 +00:00
}
],
[
{
2024-05-04 17:06:51 +00:00
label: 'Home Theater',
2023-11-08 18:16:31 +00:00
items: [{ label: 'Projector' }, { label: 'Speakers' }, { label: 'TVs' }]
2023-02-28 08:29:30 +00:00
}
],
[
{
2023-11-08 18:16:31 +00:00
label: 'Gaming',
items: [{ label: 'Accessories' }, { label: 'Console' }, { label: 'PC' }, { label: 'Video Games' }]
}
],
[
2023-02-28 08:29:30 +00:00
{
2023-11-08 18:16:31 +00:00
label: 'Appliances',
items: [{ label: 'Coffee Machine' }, { label: 'Fridge' }, { label: 'Oven' }, { label: 'Vaccum Cleaner' }, { label: 'Washing Machine' }]
2023-02-28 08:29:30 +00:00
}
]
]
},
{
2023-11-08 18:16:31 +00:00
label: 'Sports',
icon: 'pi pi-clock',
2023-02-28 08:29:30 +00:00
items: [
[
{
2023-11-08 18:16:31 +00:00
label: 'Football',
items: [{ label: 'Kits' }, { label: 'Shoes' }, { label: 'Shorts' }, { label: 'Training' }]
2023-02-28 08:29:30 +00:00
}
],
[
{
2023-11-08 18:16:31 +00:00
label: 'Running',
items: [{ label: 'Accessories' }, { label: 'Shoes' }, { label: 'T-Shirts' }, { label: 'Shorts' }]
2023-02-28 08:29:30 +00:00
}
2023-11-08 18:16:31 +00:00
],
2023-02-28 08:29:30 +00:00
[
{
2023-11-08 18:16:31 +00:00
label: 'Swimming',
items: [{ label: 'Kickboard' }, { label: 'Nose Clip' }, { label: 'Swimsuits' }, { label: 'Paddles' }]
2023-02-28 08:29:30 +00:00
}
],
[
{
2023-11-08 18:16:31 +00:00
label: 'Tennis',
items: [{ label: 'Balls' }, { label: 'Rackets' }, { label: 'Shoes' }, { label: 'Training' }]
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
<MegaMenu :model="items" />
`,
2023-09-22 12:54:14 +00:00
options: `
<template>
2023-02-28 08:29:30 +00:00
<div class="card">
<MegaMenu :model="items" />
</div>
</template>
<script>
export default {
data() {
return {
items: [
{
2023-11-08 18:16:31 +00:00
label: 'Furniture',
icon: 'pi pi-box',
2023-02-28 08:29:30 +00:00
items: [
[
{
2023-11-08 18:16:31 +00:00
label: 'Living Room',
items: [{ label: 'Accessories' }, { label: 'Armchair' }, { label: 'Coffee Table' }, { label: 'Couch' }, { label: 'TV Stand' }]
}
],
[
{
label: 'Kitchen',
items: [{ label: 'Bar stool' }, { label: 'Chair' }, { label: 'Table' }]
2023-02-28 08:29:30 +00:00
},
{
2023-11-08 18:16:31 +00:00
label: 'Bathroom',
items: [{ label: 'Accessories' }]
2023-02-28 08:29:30 +00:00
}
],
[
{
2023-11-08 18:16:31 +00:00
label: 'Bedroom',
items: [{ label: 'Bed' }, { label: 'Chaise lounge' }, { label: 'Cupboard' }, { label: 'Dresser' }, { label: 'Wardrobe' }]
}
],
[
2023-02-28 08:29:30 +00:00
{
2023-11-08 18:16:31 +00:00
label: 'Office',
items: [{ label: 'Bookcase' }, { label: 'Cabinet' }, { label: 'Chair' }, { label: 'Desk' }, { label: 'Executive Chair' }]
2023-02-28 08:29:30 +00:00
}
]
]
},
{
2023-11-08 18:16:31 +00:00
label: 'Electronics',
icon: 'pi pi-mobile',
2023-02-28 08:29:30 +00:00
items: [
[
{
2023-11-08 18:16:31 +00:00
label: 'Computer',
items: [{ label: 'Monitor' }, { label: 'Mouse' }, { label: 'Notebook' }, { label: 'Keyboard' }, { label: 'Printer' }, { label: 'Storage' }]
2023-02-28 08:29:30 +00:00
}
],
[
{
2024-05-04 17:06:51 +00:00
label: 'Home Theater',
2023-11-08 18:16:31 +00:00
items: [{ label: 'Projector' }, { label: 'Speakers' }, { label: 'TVs' }]
2023-02-28 08:29:30 +00:00
}
],
[
{
2023-11-08 18:16:31 +00:00
label: 'Gaming',
items: [{ label: 'Accessories' }, { label: 'Console' }, { label: 'PC' }, { label: 'Video Games' }]
}
],
[
2023-02-28 08:29:30 +00:00
{
2023-11-08 18:16:31 +00:00
label: 'Appliances',
items: [{ label: 'Coffee Machine' }, { label: 'Fridge' }, { label: 'Oven' }, { label: 'Vaccum Cleaner' }, { label: 'Washing Machine' }]
2023-02-28 08:29:30 +00:00
}
]
]
},
{
2023-11-08 18:16:31 +00:00
label: 'Sports',
icon: 'pi pi-clock',
2023-02-28 08:29:30 +00:00
items: [
[
{
2023-11-08 18:16:31 +00:00
label: 'Football',
items: [{ label: 'Kits' }, { label: 'Shoes' }, { label: 'Shorts' }, { label: 'Training' }]
2023-02-28 08:29:30 +00:00
}
],
[
{
2023-11-08 18:16:31 +00:00
label: 'Running',
items: [{ label: 'Accessories' }, { label: 'Shoes' }, { label: 'T-Shirts' }, { label: 'Shorts' }]
2023-02-28 08:29:30 +00:00
}
2023-11-08 18:16:31 +00:00
],
2023-02-28 08:29:30 +00:00
[
{
2023-11-08 18:16:31 +00:00
label: 'Swimming',
items: [{ label: 'Kickboard' }, { label: 'Nose Clip' }, { label: 'Swimsuits' }, { label: 'Paddles' }]
2023-02-28 08:29:30 +00:00
}
],
[
{
2023-11-08 18:16:31 +00:00
label: 'Tennis',
items: [{ label: 'Balls' }, { label: 'Rackets' }, { label: 'Shoes' }, { label: 'Training' }]
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">
<MegaMenu :model="items" />
</div>
</template>
<script setup>
import { ref } from "vue";
const items = ref([
{
2023-11-08 18:16:31 +00:00
label: 'Furniture',
icon: 'pi pi-box',
2023-02-28 08:29:30 +00:00
items: [
[
{
2023-11-08 18:16:31 +00:00
label: 'Living Room',
items: [{ label: 'Accessories' }, { label: 'Armchair' }, { label: 'Coffee Table' }, { label: 'Couch' }, { label: 'TV Stand' }]
}
],
[
{
label: 'Kitchen',
items: [{ label: 'Bar stool' }, { label: 'Chair' }, { label: 'Table' }]
2023-02-28 08:29:30 +00:00
},
{
2023-11-08 18:16:31 +00:00
label: 'Bathroom',
items: [{ label: 'Accessories' }]
2023-02-28 08:29:30 +00:00
}
],
[
{
2023-11-08 18:16:31 +00:00
label: 'Bedroom',
items: [{ label: 'Bed' }, { label: 'Chaise lounge' }, { label: 'Cupboard' }, { label: 'Dresser' }, { label: 'Wardrobe' }]
}
],
[
2023-02-28 08:29:30 +00:00
{
2023-11-08 18:16:31 +00:00
label: 'Office',
items: [{ label: 'Bookcase' }, { label: 'Cabinet' }, { label: 'Chair' }, { label: 'Desk' }, { label: 'Executive Chair' }]
2023-02-28 08:29:30 +00:00
}
]
]
},
{
2023-11-08 18:16:31 +00:00
label: 'Electronics',
icon: 'pi pi-mobile',
2023-02-28 08:29:30 +00:00
items: [
[
{
2023-11-08 18:16:31 +00:00
label: 'Computer',
items: [{ label: 'Monitor' }, { label: 'Mouse' }, { label: 'Notebook' }, { label: 'Keyboard' }, { label: 'Printer' }, { label: 'Storage' }]
2023-02-28 08:29:30 +00:00
}
],
[
{
2024-05-04 17:06:51 +00:00
label: 'Home Theater',
2023-11-08 18:16:31 +00:00
items: [{ label: 'Projector' }, { label: 'Speakers' }, { label: 'TVs' }]
2023-02-28 08:29:30 +00:00
}
],
[
{
2023-11-08 18:16:31 +00:00
label: 'Gaming',
items: [{ label: 'Accessories' }, { label: 'Console' }, { label: 'PC' }, { label: 'Video Games' }]
}
],
[
2023-02-28 08:29:30 +00:00
{
2023-11-08 18:16:31 +00:00
label: 'Appliances',
items: [{ label: 'Coffee Machine' }, { label: 'Fridge' }, { label: 'Oven' }, { label: 'Vaccum Cleaner' }, { label: 'Washing Machine' }]
2023-02-28 08:29:30 +00:00
}
]
]
},
{
2023-11-08 18:16:31 +00:00
label: 'Sports',
icon: 'pi pi-clock',
2023-02-28 08:29:30 +00:00
items: [
[
{
2023-11-08 18:16:31 +00:00
label: 'Football',
items: [{ label: 'Kits' }, { label: 'Shoes' }, { label: 'Shorts' }, { label: 'Training' }]
2023-02-28 08:29:30 +00:00
}
],
[
{
2023-11-08 18:16:31 +00:00
label: 'Running',
items: [{ label: 'Accessories' }, { label: 'Shoes' }, { label: 'T-Shirts' }, { label: 'Shorts' }]
2023-02-28 08:29:30 +00:00
}
2023-11-08 18:16:31 +00:00
],
2023-02-28 08:29:30 +00:00
[
{
2023-11-08 18:16:31 +00:00
label: 'Swimming',
items: [{ label: 'Kickboard' }, { label: 'Nose Clip' }, { label: 'Swimsuits' }, { label: 'Paddles' }]
2023-02-28 08:29:30 +00:00
}
],
[
{
2023-11-08 18:16:31 +00:00
label: 'Tennis',
items: [{ label: 'Balls' }, { label: 'Rackets' }, { label: 'Shoes' }, { label: 'Training' }]
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>