PanelMenu multiple demo added

pull/4844/head
tugcekucukoglu 2023-11-17 10:06:57 +03:00
parent 4223a8f895
commit 822d757c6b
2 changed files with 291 additions and 0 deletions

View File

@ -0,0 +1,285 @@
<template>
<DocSectionText v-bind="$attrs">
<p>Only one root menuitem at a time can be active by default, enabling <i>multiple</i> property changes this behavior to allow multiple root menuitems.</p>
</DocSectionText>
<div class="card flex justify-content-center">
<PanelMenu :model="items" multiple class="w-full md:w-20rem" />
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
items: [
{
label: 'Files',
icon: 'pi pi-file',
items: [
{
label: 'Documents',
icon: 'pi pi-file',
items: [
{
label: 'Invoices',
icon: 'pi pi-file-pdf',
items: [
{
label: 'Pending',
icon: 'pi pi-stop'
},
{
label: 'Paid',
icon: 'pi pi-check-circle'
}
]
},
{
label: 'Clients',
icon: 'pi pi-users'
}
]
},
{
label: 'Images',
icon: 'pi pi-image',
items: [
{
label: 'Logos',
icon: 'pi pi-image'
}
]
}
]
},
{
label: 'Cloud',
icon: 'pi pi-cloud',
items: [
{
label: 'Upload',
icon: 'pi pi-cloud-upload'
},
{
label: 'Download',
icon: 'pi pi-cloud-download'
},
{
label: 'Sync',
icon: 'pi pi-refresh'
}
]
},
{
label: 'Devices',
icon: 'pi pi-desktop',
items: [
{
label: 'Phone',
icon: 'pi pi-mobile'
},
{
label: 'Desktop',
icon: 'pi pi-desktop'
},
{
label: 'Tablet',
icon: 'pi pi-tablet'
}
]
}
],
code: {
basic: `
<PanelMenu :model="items" multiple />
`,
options: `
<template>
<div class="card flex justify-content-center">
<PanelMenu :model="items" multiple class="w-full md:w-20rem" />
</div>
</template>
<script>
export default {
data() {
return {
items: [
{
label: 'Files',
icon: 'pi pi-file',
items: [
{
label: 'Documents',
icon: 'pi pi-file',
items: [
{
label: 'Invoices',
icon: 'pi pi-file-pdf',
items: [
{
label: 'Pending',
icon: 'pi pi-stop'
},
{
label: 'Paid',
icon: 'pi pi-check-circle'
}
]
},
{
label: 'Clients',
icon: 'pi pi-users'
}
]
},
{
label: 'Images',
icon: 'pi pi-image',
items: [
{
label: 'Logos',
icon: 'pi pi-image'
}
]
}
]
},
{
label: 'Cloud',
icon: 'pi pi-cloud',
items: [
{
label: 'Upload',
icon: 'pi pi-cloud-upload'
},
{
label: 'Download',
icon: 'pi pi-cloud-download'
},
{
label: 'Sync',
icon: 'pi pi-refresh'
}
]
},
{
label: 'Devices',
icon: 'pi pi-desktop',
items: [
{
label: 'Phone',
icon: 'pi pi-mobile'
},
{
label: 'Desktop',
icon: 'pi pi-desktop'
},
{
label: 'Tablet',
icon: 'pi pi-tablet'
}
]
}
]
};
}
};
<\/script>
`,
composition: `
<template>
<div class="card flex justify-content-center">
<PanelMenu :model="items" multiple class="w-full md:w-20rem" />
</div>
</template>
<script setup>
import { ref } from "vue";
const items = ref([
{
label: 'Files',
icon: 'pi pi-file',
items: [
{
label: 'Documents',
icon: 'pi pi-file',
items: [
{
label: 'Invoices',
icon: 'pi pi-file-pdf',
items: [
{
label: 'Pending',
icon: 'pi pi-stop'
},
{
label: 'Paid',
icon: 'pi pi-check-circle'
}
]
},
{
label: 'Clients',
icon: 'pi pi-users'
}
]
},
{
label: 'Images',
icon: 'pi pi-image',
items: [
{
label: 'Logos',
icon: 'pi pi-image'
}
]
}
]
},
{
label: 'Cloud',
icon: 'pi pi-cloud',
items: [
{
label: 'Upload',
icon: 'pi pi-cloud-upload'
},
{
label: 'Download',
icon: 'pi pi-cloud-download'
},
{
label: 'Sync',
icon: 'pi pi-refresh'
}
]
},
{
label: 'Devices',
icon: 'pi pi-desktop',
items: [
{
label: 'Phone',
icon: 'pi pi-mobile'
},
{
label: 'Desktop',
icon: 'pi pi-desktop'
},
{
label: 'Tablet',
icon: 'pi pi-tablet'
}
]
}
]);
<\/script>
`
}
};
}
};
</script>

View File

@ -16,6 +16,7 @@ import BasicDoc from '@/doc/panelmenu/BasicDoc.vue';
import CommandDoc from '@/doc/panelmenu/CommandDoc.vue'; import CommandDoc from '@/doc/panelmenu/CommandDoc.vue';
import ControlledDoc from '@/doc/panelmenu/ControlledDoc.vue'; import ControlledDoc from '@/doc/panelmenu/ControlledDoc.vue';
import ImportDoc from '@/doc/panelmenu/ImportDoc.vue'; import ImportDoc from '@/doc/panelmenu/ImportDoc.vue';
import MultipleDoc from '@/doc/panelmenu/MultipleDoc.vue';
import RouterDoc from '@/doc/panelmenu/RouterDoc.vue'; import RouterDoc from '@/doc/panelmenu/RouterDoc.vue';
import TemplateDoc from '@/doc/panelmenu/TemplateDoc.vue'; import TemplateDoc from '@/doc/panelmenu/TemplateDoc.vue';
import PTComponent from '@/doc/panelmenu/pt/index.vue'; import PTComponent from '@/doc/panelmenu/pt/index.vue';
@ -35,6 +36,11 @@ export default {
label: 'Basic', label: 'Basic',
component: BasicDoc component: BasicDoc
}, },
{
id: 'multiple',
label: 'Multiple',
component: MultipleDoc
},
{ {
id: 'controlled', id: 'controlled',
label: 'Controlled', label: 'Controlled',