2023-02-28 08:29:30 +00:00
|
|
|
<template>
|
|
|
|
<DocSectionText v-bind="$attrs">
|
|
|
|
<p>Steps requires a collection of menuitems as its <i>model</i>. TabMenu can be also integrated with Vue Router.</p>
|
|
|
|
</DocSectionText>
|
|
|
|
<div class="card">
|
|
|
|
<TabMenu :model="items" />
|
|
|
|
<router-view />
|
|
|
|
</div>
|
|
|
|
<DocSectionCode :code="code" />
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
items: [
|
|
|
|
{ label: 'Home', icon: 'pi pi-fw pi-home', to: '/tabmenu' },
|
|
|
|
{ label: 'Calendar', icon: 'pi pi-fw pi-calendar', to: '/tabmenu/calendar' },
|
|
|
|
{ label: 'Edit', icon: 'pi pi-fw pi-pencil', to: '/tabmenu/edit' },
|
|
|
|
{ label: 'Documentation', icon: 'pi pi-fw pi-file', to: '/tabmenu/documentation' },
|
|
|
|
{ label: 'Settings', icon: 'pi pi-fw pi-cog', to: '/tabmenu/settings' }
|
|
|
|
],
|
|
|
|
code: {
|
2023-08-16 13:58:31 +00:00
|
|
|
basic: `<TabMenu :model="items" />
|
2023-02-28 08:29:30 +00:00
|
|
|
<router-view />`,
|
2023-08-16 13:58:31 +00:00
|
|
|
options: `<template>
|
2023-02-28 08:29:30 +00:00
|
|
|
<div class="card">
|
|
|
|
<TabMenu :model="items" />
|
|
|
|
<router-view />
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Home',
|
|
|
|
icon: 'pi pi-fw pi-home',
|
|
|
|
to: '/'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Calendar',
|
|
|
|
icon: 'pi pi-fw pi-calendar',
|
|
|
|
to: '/calendar'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Edit',
|
|
|
|
icon: 'pi pi-fw pi-pencil',
|
|
|
|
to: '/edit'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Documentation',
|
|
|
|
icon: 'pi pi-fw pi-file',
|
|
|
|
to: '/documentation'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Settings',
|
|
|
|
icon: 'pi pi-fw pi-cog',
|
|
|
|
to: '/settings'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
<\/script>`,
|
2023-08-16 13:58:31 +00:00
|
|
|
composition: `<template>
|
2023-02-28 08:29:30 +00:00
|
|
|
<div class="card">
|
|
|
|
<TabMenu :model="items" />
|
|
|
|
<router-view />
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
import { ref } from "vue";
|
|
|
|
|
|
|
|
const items = ref([
|
|
|
|
{
|
|
|
|
label: 'Home',
|
|
|
|
icon: 'pi pi-fw pi-home',
|
|
|
|
to: '/'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Calendar',
|
|
|
|
icon: 'pi pi-fw pi-calendar',
|
|
|
|
to: '/calendar'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Edit',
|
|
|
|
icon: 'pi pi-fw pi-pencil',
|
|
|
|
to: '/edit'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Documentation',
|
|
|
|
icon: 'pi pi-fw pi-file',
|
|
|
|
to: '/documentation'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Settings',
|
|
|
|
icon: 'pi pi-fw pi-cog',
|
|
|
|
to: '/settings'
|
|
|
|
}
|
|
|
|
]);
|
|
|
|
|
|
|
|
<\/script>`,
|
|
|
|
pages: [
|
|
|
|
{
|
|
|
|
tabName: 'HomeDemo',
|
|
|
|
content: `
|
|
|
|
<template>
|
2023-08-02 14:03:56 +00:00
|
|
|
<div class="p-4">
|
2023-02-28 08:29:30 +00:00
|
|
|
<h5>Home Component Content</h5>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
|
|
|
|
}
|
|
|
|
<\/script>
|
|
|
|
`
|
|
|
|
},
|
|
|
|
{
|
|
|
|
tabName: 'CalendarDemo',
|
|
|
|
content: `
|
|
|
|
<template>
|
2023-08-02 14:03:56 +00:00
|
|
|
<div class="p-4">
|
2023-02-28 08:29:30 +00:00
|
|
|
<h5>Calendar Component Content</h5>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
|
|
|
|
}
|
|
|
|
<\/script>
|
|
|
|
`
|
|
|
|
},
|
|
|
|
{
|
|
|
|
tabName: 'EditDemo',
|
|
|
|
content: `
|
|
|
|
<template>
|
2023-08-02 14:03:56 +00:00
|
|
|
<div class="p-4">
|
2023-02-28 08:29:30 +00:00
|
|
|
<h5>Edit Component Content</h5>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
|
|
|
|
}
|
|
|
|
<\/script>
|
|
|
|
`
|
|
|
|
},
|
|
|
|
{
|
|
|
|
tabName: 'DocumentationDemo',
|
|
|
|
content: `
|
|
|
|
<template>
|
2023-08-02 14:03:56 +00:00
|
|
|
<div class="p-4">
|
2023-02-28 08:29:30 +00:00
|
|
|
<h5>Documentation Component Content</h5>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
|
|
|
|
}
|
|
|
|
<\/script>
|
|
|
|
`
|
|
|
|
},
|
|
|
|
{
|
|
|
|
tabName: 'SettingsDemo',
|
|
|
|
content: `
|
|
|
|
<template>
|
2023-08-02 14:03:56 +00:00
|
|
|
<div class="p-4">
|
2023-02-28 08:29:30 +00:00
|
|
|
<h5>Settings Component Content</h5>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
|
|
|
|
}
|
|
|
|
<\/script>`
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|