primevue-mirror/doc/panelmenu/BasicDoc.vue

286 lines
8.6 KiB
Vue
Raw Normal View History

2023-02-28 08:29:30 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>PanelMenu requires a collection of menuitems as its <i>model</i>.</p>
</DocSectionText>
<div class="card flex justify-content-center">
2023-11-08 08:33:18 +00:00
<PanelMenu :model="items" class="w-full md:w-20rem" />
2023-02-28 08:29:30 +00:00
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
items: [
{
2023-11-08 08:33:18 +00:00
label: 'Files',
icon: 'pi pi-file',
2023-02-28 08:29:30 +00:00
items: [
{
2023-11-08 08:33:18 +00:00
label: 'Documents',
icon: 'pi pi-file',
2023-02-28 08:29:30 +00:00
items: [
{
2023-11-08 08:33:18 +00:00
label: 'Invoices',
icon: 'pi pi-file-pdf',
items: [
{
label: 'Pending',
icon: 'pi pi-stop'
},
{
label: 'Paid',
icon: 'pi pi-check-circle'
}
]
2023-02-28 08:29:30 +00:00
},
{
2023-11-08 08:33:18 +00:00
label: 'Clients',
icon: 'pi pi-users'
2023-02-28 08:29:30 +00:00
}
]
},
{
2023-11-08 08:33:18 +00:00
label: 'Images',
icon: 'pi pi-image',
items: [
{
label: 'Logos',
icon: 'pi pi-image'
}
]
2023-02-28 08:29:30 +00:00
}
]
},
{
2023-11-08 08:33:18 +00:00
label: 'Cloud',
icon: 'pi pi-cloud',
2023-02-28 08:29:30 +00:00
items: [
{
2023-11-08 08:33:18 +00:00
label: 'Upload',
icon: 'pi pi-cloud-upload'
2023-02-28 08:29:30 +00:00
},
{
2023-11-08 08:33:18 +00:00
label: 'Download',
icon: 'pi pi-cloud-download'
2023-02-28 08:29:30 +00:00
},
{
2023-11-08 08:33:18 +00:00
label: 'Sync',
icon: 'pi pi-refresh'
2023-02-28 08:29:30 +00:00
}
]
},
{
2023-11-08 08:33:18 +00:00
label: 'Devices',
icon: 'pi pi-desktop',
2023-02-28 08:29:30 +00:00
items: [
{
2023-11-08 08:33:18 +00:00
label: 'Phone',
icon: 'pi pi-mobile'
2023-02-28 08:29:30 +00:00
},
{
2023-11-08 08:33:18 +00:00
label: 'Desktop',
icon: 'pi pi-desktop'
2023-02-28 08:29:30 +00:00
},
{
2023-11-08 08:33:18 +00:00
label: 'Tablet',
icon: 'pi pi-tablet'
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
<PanelMenu :model="items" />
`,
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">
2023-11-08 08:33:18 +00:00
<PanelMenu :model="items" class="w-full md:w-20rem" />
2023-02-28 08:29:30 +00:00
</div>
</template>
<script>
export default {
data() {
return {
items: [
{
2023-11-08 08:33:18 +00:00
label: 'Files',
icon: 'pi pi-file',
2023-02-28 08:29:30 +00:00
items: [
{
2023-11-08 08:33:18 +00:00
label: 'Documents',
icon: 'pi pi-file',
2023-02-28 08:29:30 +00:00
items: [
{
2023-11-08 08:33:18 +00:00
label: 'Invoices',
icon: 'pi pi-file-pdf',
items: [
{
label: 'Pending',
icon: 'pi pi-stop'
},
{
label: 'Paid',
icon: 'pi pi-check-circle'
}
]
2023-02-28 08:29:30 +00:00
},
{
2023-11-08 08:33:18 +00:00
label: 'Clients',
icon: 'pi pi-users'
2023-02-28 08:29:30 +00:00
}
]
},
{
2023-11-08 08:33:18 +00:00
label: 'Images',
icon: 'pi pi-image',
items: [
{
label: 'Logos',
icon: 'pi pi-image'
}
]
2023-02-28 08:29:30 +00:00
}
]
},
{
2023-11-08 08:33:18 +00:00
label: 'Cloud',
icon: 'pi pi-cloud',
2023-02-28 08:29:30 +00:00
items: [
{
2023-11-08 08:33:18 +00:00
label: 'Upload',
icon: 'pi pi-cloud-upload'
2023-02-28 08:29:30 +00:00
},
{
2023-11-08 08:33:18 +00:00
label: 'Download',
icon: 'pi pi-cloud-download'
2023-02-28 08:29:30 +00:00
},
{
2023-11-08 08:33:18 +00:00
label: 'Sync',
icon: 'pi pi-refresh'
2023-02-28 08:29:30 +00:00
}
]
},
{
2023-11-08 08:33:18 +00:00
label: 'Devices',
icon: 'pi pi-desktop',
2023-02-28 08:29:30 +00:00
items: [
{
2023-11-08 08:33:18 +00:00
label: 'Phone',
icon: 'pi pi-mobile'
2023-02-28 08:29:30 +00:00
},
{
2023-11-08 08:33:18 +00:00
label: 'Desktop',
icon: 'pi pi-desktop'
2023-02-28 08:29:30 +00:00
},
{
2023-11-08 08:33:18 +00:00
label: 'Tablet',
icon: 'pi pi-tablet'
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 flex justify-content-center">
2023-11-08 08:33:18 +00:00
<PanelMenu :model="items" class="w-full md:w-20rem" />
2023-02-28 08:29:30 +00:00
</div>
</template>
<script setup>
import { ref } from "vue";
const items = ref([
{
2023-11-08 08:33:18 +00:00
label: 'Files',
icon: 'pi pi-file',
2023-02-28 08:29:30 +00:00
items: [
{
2023-11-08 08:33:18 +00:00
label: 'Documents',
icon: 'pi pi-file',
2023-02-28 08:29:30 +00:00
items: [
{
2023-11-08 08:33:18 +00:00
label: 'Invoices',
icon: 'pi pi-file-pdf',
items: [
{
label: 'Pending',
icon: 'pi pi-stop'
},
{
label: 'Paid',
icon: 'pi pi-check-circle'
}
]
2023-02-28 08:29:30 +00:00
},
{
2023-11-08 08:33:18 +00:00
label: 'Clients',
icon: 'pi pi-users'
2023-02-28 08:29:30 +00:00
}
]
},
{
2023-11-08 08:33:18 +00:00
label: 'Images',
icon: 'pi pi-image',
items: [
{
label: 'Logos',
icon: 'pi pi-image'
}
]
2023-02-28 08:29:30 +00:00
}
]
},
{
2023-11-08 08:33:18 +00:00
label: 'Cloud',
icon: 'pi pi-cloud',
2023-02-28 08:29:30 +00:00
items: [
{
2023-11-08 08:33:18 +00:00
label: 'Upload',
icon: 'pi pi-cloud-upload'
2023-02-28 08:29:30 +00:00
},
{
2023-11-08 08:33:18 +00:00
label: 'Download',
icon: 'pi pi-cloud-download'
2023-02-28 08:29:30 +00:00
},
{
2023-11-08 08:33:18 +00:00
label: 'Sync',
icon: 'pi pi-refresh'
2023-02-28 08:29:30 +00:00
}
]
},
{
2023-11-08 08:33:18 +00:00
label: 'Devices',
icon: 'pi pi-desktop',
2023-02-28 08:29:30 +00:00
items: [
{
2023-11-08 08:33:18 +00:00
label: 'Phone',
icon: 'pi pi-mobile'
2023-02-28 08:29:30 +00:00
},
{
2023-11-08 08:33:18 +00:00
label: 'Desktop',
icon: 'pi pi-desktop'
2023-02-28 08:29:30 +00:00
},
{
2023-11-08 08:33:18 +00:00
label: 'Tablet',
icon: 'pi pi-tablet'
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>