Rename to -> route

pull/4356/head
Cagatay Civici 2023-08-30 11:53:10 +03:00
parent a5e4156c82
commit 3982a16db7
1 changed files with 7 additions and 11 deletions

View File

@ -8,7 +8,7 @@
<div class="card flex justify-content-center"> <div class="card flex justify-content-center">
<Menu :model="items"> <Menu :model="items">
<template #item="{ label, item, props }"> <template #item="{ label, item, props }">
<router-link v-if="item.to" v-slot="routerProps" :to="item.to" custom> <router-link v-if="item.route" v-slot="routerProps" :to="item.route" custom>
<a :href="routerProps.href" v-bind="props.action"> <a :href="routerProps.href" v-bind="props.action">
<span v-bind="props.icon" /> <span v-bind="props.icon" />
<span v-bind="props.label">{{ label }}</span> <span v-bind="props.label">{{ label }}</span>
@ -60,7 +60,7 @@ export default {
{ {
label: 'Upload', label: 'Upload',
icon: 'pi pi-upload', icon: 'pi pi-upload',
to: '/fileupload' route: '/fileupload'
} }
] ]
} }
@ -68,7 +68,7 @@ export default {
code: { code: {
basic: `<Menu :model="items"> basic: `<Menu :model="items">
<template #item="{ label, item, props }"> <template #item="{ label, item, props }">
<router-link v-if="item.to" v-slot="routerProps" :to="item.to" custom> <router-link v-if="item.route" v-slot="routerProps" :to="item.route" custom>
<a :href="routerProps.href" v-bind="props.action"> <a :href="routerProps.href" v-bind="props.action">
<span v-bind="props.icon" /> <span v-bind="props.icon" />
<span v-bind="props.label">{{ label }}</span> <span v-bind="props.label">{{ label }}</span>
@ -84,7 +84,7 @@ export default {
<div class="card flex justify-content-center"> <div class="card flex justify-content-center">
<Menu :model="items"> <Menu :model="items">
<template #item="{ label, item, props }"> <template #item="{ label, item, props }">
<router-link v-if="item.to" v-slot="routerProps" :to="item.to" custom> <router-link v-if="item.route" v-slot="routerProps" :to="item.route" custom>
<a :href="routerProps.href" v-bind="props.action"> <a :href="routerProps.href" v-bind="props.action">
<span v-bind="props.icon" /> <span v-bind="props.icon" />
<span v-bind="props.label">{{ label }}</span> <span v-bind="props.label">{{ label }}</span>
@ -137,9 +137,7 @@ export default {
{ {
label: 'Upload', label: 'Upload',
icon: 'pi pi-upload', icon: 'pi pi-upload',
command: () => { route: '/fileupload'
this.$toast.add({ severity: 'success', summary: 'Upload', detail: 'File Uploaded', life: 3000 });
}
} }
] ]
} }
@ -152,7 +150,7 @@ export default {
<div class="card flex justify-content-center"> <div class="card flex justify-content-center">
<Menu :model="items"> <Menu :model="items">
<template #item="{ label, item, props }"> <template #item="{ label, item, props }">
<router-link v-if="item.to" v-slot="routerProps" :to="item.to" custom> <router-link v-if="item.route" v-slot="routerProps" :to="item.route" custom>
<a :href="routerProps.href" v-bind="props.action"> <a :href="routerProps.href" v-bind="props.action">
<span v-bind="props.icon" /> <span v-bind="props.icon" />
<span v-bind="props.label">{{ label }}</span> <span v-bind="props.label">{{ label }}</span>
@ -204,9 +202,7 @@ const items = ref(items: [
{ {
label: 'Upload', label: 'Upload',
icon: 'pi pi-upload', icon: 'pi pi-upload',
command: () => { route: '/fileupload'
this.$toast.add({ severity: 'success', summary: 'Upload', detail: 'File Uploaded', life: 3000 });
}
} }
] ]
} }