Skip to content

Commit

Permalink
Merge branch 'prod'
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Nov 4, 2023
2 parents b941287 + 7757516 commit edb19d8
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 101 deletions.
33 changes: 15 additions & 18 deletions doc/breadcrumb/BasicDoc.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<DocSectionText v-bind="$attrs">
<p>Breadcrumb requires a collection of menuitems as its <i>model</i>.</p>
<p>Breadcrumb requires a collection of menuitems as its <i>model</i>, the root item is defined with the <i>home</i> property.</p>
</DocSectionText>
<div class="card flex justify-content-center">
<Breadcrumb :home="home" :model="items" />
Expand All @@ -13,10 +13,9 @@ export default {
data() {
return {
home: {
icon: 'pi pi-home',
to: '/'
icon: 'pi pi-home'
},
items: [{ label: 'Computer' }, { label: 'Notebook' }, { label: 'Accessories' }, { label: 'Backpacks' }, { label: 'Item' }],
items: [{ label: 'Electronics' }, { label: 'Computer' }, { label: 'Accessories' }, { label: 'Keyboard' }, { label: 'Wireless' }],
code: {
basic: `
<Breadcrumb :home="home" :model="items" />
Expand All @@ -33,15 +32,14 @@ export default {
data() {
return {
home: {
icon: 'pi pi-home',
to: '/',
icon: 'pi pi-home'
},
items: [
{label: 'Computer'},
{label: 'Notebook'},
{label: 'Accessories'},
{label: 'Backpacks'},
{label: 'Item'}
{ label: 'Electronics' },
{ label: 'Computer' },
{ label: 'Accessories' },
{ label: 'Keyboard' },
{ label: 'Wireless' }
]
}
}
Expand All @@ -59,15 +57,14 @@ export default {
import { ref } from "vue";
const home = ref({
icon: 'pi pi-home',
to: '/',
icon: 'pi pi-home'
});
const items = ref([
{label: 'Computer'},
{label: 'Notebook'},
{label: 'Accessories'},
{label: 'Backpacks'},
{label: 'Item'}
{ label: 'Electronics' },
{ label: 'Computer' },
{ label: 'Accessories' },
{ label: 'Keyboard' },
{ label: 'Wireless' }
]);
<\/script>
`
Expand Down
83 changes: 36 additions & 47 deletions doc/breadcrumb/RouterDoc.vue
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
<template>
<DocSectionText v-bind="$attrs">
<p>
Since v3.33.0 the vue-router dependency of menu components is deprecated and templating should be used to define router links instead. This approach provides flexibility to be able to use any kind of router link component such as
<i>NuxtLink</i> or <i>router-link</i>. Here is an example with vue-router.
</p>
<p>Items with navigation are defined with templating to be able to use a router link component, an external link or programmatic navigation.</p>
</DocSectionText>
<div class="card flex justify-content-center">
<Breadcrumb :home="home" :model="items">
<template #item="{ label, item, props }">
<router-link v-if="item.route" v-slot="routerProps" :to="item.route" custom>
<a :href="routerProps.href" v-bind="props.action">
<span v-bind="props.icon" />
<span v-bind="props.label">{{ label }}</span>
<template #item="{ item, props }">
<router-link v-if="item.route" v-slot="{ href, navigate }" :to="item.route" custom>
<a :href="href" v-bind="props.action" @click="navigate">
<span :class="[item.icon, 'text-color']" />
<span class="text-primary font-semibold">{{ item.label }}</span>
</a>
</router-link>
<a v-else :href="item.url" :target="item.target" v-bind="props.action">
<span v-if="item.icon" v-bind="props.icon" />
<span v-bind="props.label">{{ label }}</span>
<span class="text-color">{{ item.label }}</span>
</a>
</template>
</Breadcrumb>
</div>
<DocSectionCode :code="code" />
<DocSectionCode :code="code" hideStackBlitz hideCodeSandbox />
</template>

<script>
Expand All @@ -30,22 +26,21 @@ export default {
return {
home: {
icon: 'pi pi-home',
route: '/'
route: '/installation'
},
items: [{ label: 'Computer' }, { label: 'Notebook' }, { label: 'Accessories' }, { label: 'Backpacks' }, { label: 'Item' }],
items: [{ label: 'Components' }, { label: 'Form' }, { label: 'InputText', route: '/inputtext' }],
code: {
basic: `
<Breadcrumb :home="home" :model="items">
<template #item="{ label, item, props }">
<router-link v-if="item.route" v-slot="routerProps" :to="item.route" custom>
<a :href="routerProps.href" v-bind="props.action">
<span v-bind="props.icon" />
<span v-bind="props.label">{{ label }}</span>
<template #item="{ item, props }">
<router-link v-if="item.route" v-slot="{ href, navigate }" :to="item.route" custom>
<a :href="href" v-bind="props.action" @click="navigate">
<span :class="[item.icon, 'text-color']" />
<span class="text-primary font-semibold">{{ item.label }}</span>
</a>
</router-link>
<a v-else :href="item.url" :target="item.target" v-bind="props.action">
<span v-if="item.icon" v-bind="props.icon" />
<span v-bind="props.label">{{ label }}</span>
<span class="text-color">{{ item.label }}</span>
</a>
</template>
</Breadcrumb>
Expand All @@ -54,16 +49,15 @@ export default {
<template>
<div class="card flex justify-content-center">
<Breadcrumb :home="home" :model="items">
<template #item="{ label, item, props }">
<router-link v-if="item.route" v-slot="routerProps" :to="item.route" custom>
<a :href="routerProps.href" v-bind="props.action">
<span v-bind="props.icon" />
<span v-bind="props.label">{{ label }}</span>
<template #item="{ item, props }">
<router-link v-if="item.route" v-slot="{ href, navigate }" :to="item.route" custom>
<a :href="href" v-bind="props.action" @click="navigate">
<span :class="[item.icon, 'text-color']" />
<span class="text-primary font-semibold">{{ item.label }}</span>
</a>
</router-link>
<a v-else :href="item.url" :target="item.target" v-bind="props.action">
<span v-if="item.icon" v-bind="props.icon" />
<span v-bind="props.label">{{ label }}</span>
<span class="text-color">{{ item.label }}</span>
</a>
</template>
</Breadcrumb>
Expand All @@ -76,14 +70,12 @@ export default {
return {
home: {
icon: 'pi pi-home',
route: '/'
route: '/installation'
},
items: [
{label: 'Computer'},
{label: 'Notebook'},
{label: 'Accessories'},
{label: 'Backpacks'},
{label: 'Item'}
{ label: 'Components' },
{ label: 'Form' },
{ label: 'InputText', route: '/inputtext' }
]
}
}
Expand All @@ -94,16 +86,15 @@ export default {
<template>
<div class="card flex justify-content-center">
<Breadcrumb :home="home" :model="items">
<template #item="{ label, item, props }">
<router-link v-if="item.route" v-slot="routerProps" :to="item.route" custom>
<a :href="routerProps.href" v-bind="props.action">
<span v-bind="props.icon" />
<span v-bind="props.label">{{ label }}</span>
<template #item="{ item, props }">
<router-link v-if="item.route" v-slot="{ href, navigate }" :to="item.route" custom>
<a :href="href" v-bind="props.action" @click="navigate">
<span :class="[item.icon, 'text-color']" />
<span class="text-primary font-semibold">{{ item.label }}</span>
</a>
</router-link>
<a v-else :href="item.url" :target="item.target" v-bind="props.action">
<span v-if="item.icon" v-bind="props.icon" />
<span v-bind="props.label">{{ label }}</span>
<span class="text-color">{{ item.label }}</span>
</a>
</template>
</Breadcrumb>
Expand All @@ -115,14 +106,12 @@ import { ref } from "vue";
const home = ref({
icon: 'pi pi-home',
route: '/'
route: '/installation'
});
const items = ref([
{label: 'Computer'},
{label: 'Notebook'},
{label: 'Accessories'},
{label: 'Backpacks'},
{label: 'Item'}
{ label: 'Components' },
{ label: 'Form' },
{ label: 'InputText', route: '/inputtext' }
]);
<\/script>
`
Expand Down
31 changes: 18 additions & 13 deletions doc/breadcrumb/TemplateDoc.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<template>
<DocSectionText v-bind="$attrs">
<p>Custom content can be placed inside the menuitem using the <i>item</i> templating.</p>
<p>Custom content can be placed inside the items using the <i>item</i> template. The divider between the items has its own <i>separator</i> template.</p>
</DocSectionText>
<div class="card flex justify-content-center">
<Breadcrumb :home="home" :model="items">
<template #item="{ item }">
<a :class="item.class" :href="item.url">
<a class="cursor-pointer" :href="item.url">
<span :class="item.icon"></span>
</a>
</template>
<template #separator> / </template>
</Breadcrumb>
</div>
<DocSectionCode :code="code" />
Expand All @@ -18,27 +19,31 @@
export default {
data() {
return {
home: { icon: 'pi pi-home', url: 'https://primevue.org/' },
home: { icon: 'pi pi-home' },
items: [{ icon: 'pi pi-sitemap' }, { icon: 'pi pi-book' }, { icon: 'pi pi-wallet' }, { icon: 'pi pi-shopping-bag' }, { icon: 'pi pi-calculator' }],
code: {
basic: `
<Breadcrumb :home="home" :model="items">
<template #item="item">
<a :class="item.class">
<span :class="item.icon"></span>
</a>
<template #item="{ item }">
<a class="cursor-pointer" :href="item.url">
<span :class="item.icon"></span>
</a>
</template>
<template #separator> / </template>
</template>
</Breadcrumb>
`,
options: `
<template>
<div class="card flex justify-content-center">
<Breadcrumb :home="home" :model="items">
<template #item="{item}">
<a :class="item.class">
<template #item="{ item }">
<a class="cursor-pointer" :href="item.url">
<span :class="item.icon"></span>
</a>
</template>
<template #separator> / </template>
</Breadcrumb>
</div>
</template>
Expand All @@ -47,7 +52,7 @@ export default {
export default {
data() {
return {
home: { icon: 'pi pi-home', url: 'https://primevue.org/' },
home: { icon: 'pi pi-home' },
items: [{ icon: 'pi pi-sitemap' }, { icon: 'pi pi-book' }, { icon: 'pi pi-wallet' }, { icon: 'pi pi-shopping-bag' }, { icon: 'pi pi-calculator' }]
}
}
Expand All @@ -58,21 +63,21 @@ export default {
<template>
<div class="card flex justify-content-center">
<Breadcrumb :home="home" :model="items">
<template #item="{item}">
<a :class="item.class">
<template #item="{ item }">
<a class="cursor-pointer" :href="item.url">
<span :class="item.icon"></span>
</a>
</template>
<template #separator> / </template>
</Breadcrumb>
</div>
</template>
<script setup>
import { ref } from "vue";
const home = ref({ icon: 'pi pi-home', url: 'https://primevue.org/' });
const home = ref({ icon: 'pi pi-home' });
const items = ref([{ icon: 'pi pi-sitemap' }, { icon: 'pi pi-book' }, { icon: 'pi pi-wallet' }, { icon: 'pi pi-shopping-bag' }, { icon: 'pi pi-calculator' }]);
}
<\/script>
`
}
Expand Down
2 changes: 1 addition & 1 deletion doc/dock/AdvancedDoc.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<DocSectionText v-bind="$attrs">
<p>A sample macOS implementation using various components.</p>
<p>A sample desktop demo using various components.</p>
</DocSectionText>
<div class="card dock-demo">
<Toast position="top-center" group="tc" />
Expand Down
2 changes: 1 addition & 1 deletion doc/dock/BasicDoc.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<DocSectionText v-bind="$attrs">
<p>Menu requires a collection of menuitems as its <i>model</i>. Default location is <i>bottom</i> and other sides are also available when defined with the <i>position</i> property.</p>
<p>Menu requires a collection of menuitems as its <i>model</i> and an <i>icon</i> template. Default location is <i>bottom</i> and other edges are also available when defined with the <i>position</i> property.</p>
</DocSectionText>
<div class="card dock-demo">
<div class="flex flex-wrap gap-3 mb-5">
Expand Down
8 changes: 0 additions & 8 deletions doc/dock/RouterDoc.vue

This file was deleted.

14 changes: 7 additions & 7 deletions doc/menu/RouterDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Menu :model="items">
<template #item="{ item, props }">
<router-link v-if="item.route" v-slot="{ href, navigate }" :to="item.route" custom>
<a :href="href" v-bind="props.action" @click="navigate">
<a v-ripple :href="href" v-bind="props.action" @click="navigate">
<span :class="item.icon" />
<span class="ml-2">{{ item.label }}</span>
</a>
Expand Down Expand Up @@ -43,7 +43,7 @@ export default {
},
{
label: 'External',
icon: 'pi pi-external-link',
icon: 'pi pi-home',
url: 'https://vuejs.org/'
}
]
Expand All @@ -54,7 +54,7 @@ export default {
<Menu :model="items">
<template #item="{ item, props }">
<router-link v-if="item.route" v-slot="{ href, navigate }" :to="item.route" custom>
<a :href="href" v-bind="props.action" @click="navigate">
<a v-ripple :href="href" v-bind="props.action" @click="navigate">
<span :class="item.icon" />
<span class="ml-2">{{ item.label }}</span>
</a>
Expand All @@ -72,7 +72,7 @@ export default {
<Menu :model="items">
<template #item="{ item, props }">
<router-link v-if="item.route" v-slot="{ href, navigate }" :to="item.route" custom>
<a :href="href" v-bind="props.action" @click="navigate">
<a v-ripple :href="href" v-bind="props.action" @click="navigate">
<span :class="item.icon" />
<span class="ml-2">{{ item.label }}</span>
</a>
Expand Down Expand Up @@ -105,7 +105,7 @@ export default {
},
{
label: 'External',
icon: 'pi pi-external-link',
icon: 'pi pi-home',
url: 'https://vuejs.org/'
}
]
Expand All @@ -120,7 +120,7 @@ export default {
<Menu :model="items">
<template #item="{ item, props }">
<router-link v-if="item.route" v-slot="{ href, navigate }" :to="item.route" custom>
<a :href="href" v-bind="props.action" @click="navigate">
<a v-ripple :href="href" v-bind="props.action" @click="navigate">
<span :class="item.icon" />
<span class="ml-2">{{ item.label }}</span>
</a>
Expand Down Expand Up @@ -155,7 +155,7 @@ const items = ref([
},
{
label: 'External',
icon: 'pi pi-external-link',
icon: 'pi pi-home',
url: 'https://vuejs.org/'
}
]);
Expand Down
Loading

0 comments on commit edb19d8

Please sign in to comment.