primevue-mirror/apps/showcase/doc/megamenu/VerticalDoc.vue

340 lines
13 KiB
Vue
Raw Normal View History

2023-02-28 08:29:30 +00:00
<template>
<DocSectionText v-bind="$attrs">
2023-11-09 07:29:50 +00:00
<p>Layout of the MegaMenu is configured with the <i>orientation</i> property that accepts <i>horizontal</i> and <i>vertical</i> as options.</p>
2023-02-28 08:29:30 +00:00
</DocSectionText>
<div class="card">
<MegaMenu :model="items" orientation="vertical" />
</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" orientation="vertical" />
`,
2023-09-22 12:54:14 +00:00
options: `
<template>
2023-02-28 08:29:30 +00:00
<div class="card">
<MegaMenu :model="items" orientation="vertical" />
</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" orientation="vertical" />
</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>