primevue-mirror/apps/showcase/doc/menubar/BasicDoc.vue

190 lines
4.9 KiB
Vue
Raw Normal View History

2023-02-28 08:29:30 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>Menubar requires a collection of menuitems as its <i>model</i>.</p>
</DocSectionText>
2023-11-07 14:22:54 +00:00
<div class="card">
2023-02-28 08:29:30 +00:00
<Menubar :model="items" />
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
items: [
{
2023-11-07 14:22:54 +00:00
label: 'Home',
icon: 'pi pi-home'
2023-02-28 08:29:30 +00:00
},
{
2023-11-07 14:22:54 +00:00
label: 'Features',
icon: 'pi pi-star'
2023-02-28 08:29:30 +00:00
},
{
2023-11-07 14:22:54 +00:00
label: 'Projects',
icon: 'pi pi-search',
2023-02-28 08:29:30 +00:00
items: [
{
2023-11-07 14:22:54 +00:00
label: 'Components',
icon: 'pi pi-bolt'
2023-02-28 08:29:30 +00:00
},
{
2023-11-07 14:22:54 +00:00
label: 'Blocks',
icon: 'pi pi-server'
2023-02-28 08:29:30 +00:00
},
{
2023-11-07 14:22:54 +00:00
label: 'UI Kit',
icon: 'pi pi-pencil'
},
2023-02-28 08:29:30 +00:00
{
2023-11-07 14:22:54 +00:00
label: 'Templates',
icon: 'pi pi-palette',
2023-02-28 08:29:30 +00:00
items: [
{
2023-11-07 14:22:54 +00:00
label: 'Apollo',
icon: 'pi pi-palette'
2023-02-28 08:29:30 +00:00
},
{
2023-11-07 14:22:54 +00:00
label: 'Ultima',
icon: 'pi pi-palette'
2023-02-28 08:29:30 +00:00
}
]
}
]
},
{
2023-11-07 14:22:54 +00:00
label: 'Contact',
icon: 'pi pi-envelope'
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
<Menubar :model="items" />
`,
2023-09-22 12:54:14 +00:00
options: `
<template>
2023-11-07 14:22:54 +00:00
<div class="card">
2023-02-28 08:29:30 +00:00
<Menubar :model="items" />
</div>
</template>
<script>
export default {
data() {
return {
items: [
{
2023-11-07 14:22:54 +00:00
label: 'Home',
icon: 'pi pi-home'
2023-02-28 08:29:30 +00:00
},
{
2023-11-07 14:22:54 +00:00
label: 'Features',
icon: 'pi pi-star'
2023-02-28 08:29:30 +00:00
},
{
2023-11-07 14:22:54 +00:00
label: 'Projects',
icon: 'pi pi-search',
2023-02-28 08:29:30 +00:00
items: [
{
2023-11-07 14:22:54 +00:00
label: 'Components',
icon: 'pi pi-bolt'
2023-02-28 08:29:30 +00:00
},
{
2023-11-07 14:22:54 +00:00
label: 'Blocks',
icon: 'pi pi-server'
2023-02-28 08:29:30 +00:00
},
{
2023-11-07 14:22:54 +00:00
label: 'UI Kit',
icon: 'pi pi-pencil'
},
2023-02-28 08:29:30 +00:00
{
2023-11-07 14:22:54 +00:00
label: 'Templates',
icon: 'pi pi-palette',
2023-02-28 08:29:30 +00:00
items: [
{
2023-11-07 14:22:54 +00:00
label: 'Apollo',
icon: 'pi pi-palette'
2023-02-28 08:29:30 +00:00
},
{
2023-11-07 14:22:54 +00:00
label: 'Ultima',
icon: 'pi pi-palette'
2023-02-28 08:29:30 +00:00
}
]
}
]
},
{
2023-11-07 14:22:54 +00:00
label: 'Contact',
icon: 'pi pi-envelope'
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-11-07 14:22:54 +00:00
<div class="card">
2023-02-28 08:29:30 +00:00
<Menubar :model="items" />
</div>
</template>
<script setup>
import { ref } from "vue";
const items = ref([
{
2023-11-07 14:22:54 +00:00
label: 'Home',
icon: 'pi pi-home'
2023-02-28 08:29:30 +00:00
},
{
2023-11-07 14:22:54 +00:00
label: 'Features',
icon: 'pi pi-star'
2023-02-28 08:29:30 +00:00
},
{
2023-11-07 14:22:54 +00:00
label: 'Projects',
icon: 'pi pi-search',
2023-02-28 08:29:30 +00:00
items: [
{
2023-11-07 14:22:54 +00:00
label: 'Components',
icon: 'pi pi-bolt'
2023-02-28 08:29:30 +00:00
},
{
2023-11-07 14:22:54 +00:00
label: 'Blocks',
icon: 'pi pi-server'
2023-02-28 08:29:30 +00:00
},
{
2023-11-07 14:22:54 +00:00
label: 'UI Kit',
icon: 'pi pi-pencil'
},
2023-02-28 08:29:30 +00:00
{
2023-11-07 14:22:54 +00:00
label: 'Templates',
icon: 'pi pi-palette',
2023-02-28 08:29:30 +00:00
items: [
{
2023-11-07 14:22:54 +00:00
label: 'Apollo',
icon: 'pi pi-palette'
2023-02-28 08:29:30 +00:00
},
{
2023-11-07 14:22:54 +00:00
label: 'Ultima',
icon: 'pi pi-palette'
2023-02-28 08:29:30 +00:00
}
]
}
]
},
{
2023-11-07 14:22:54 +00:00
label: 'Contact',
icon: 'pi pi-envelope'
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>