Skip to content

Commit 19fe48f

Browse files
committed
Merge branch 'next' of github.com:devforth/adminforth into next
2 parents bee8c22 + 43f2925 commit 19fe48f

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

adminforth/documentation/docs/tutorial/03-Customization/06-customPages.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,4 +459,38 @@ You can navigate user to this page using any router link, e.g.:
459459
460460
```ts
461461
import { Link } from '@/afcl';
462+
```
463+
464+
### Passing meta attributes to the page
465+
466+
467+
You can add custom meta attributes to the page by passing `meta` object to the page:
468+
469+
470+
```ts title="/index.ts"
471+
472+
customPages: [
473+
{
474+
path: '/setup2fa', // route path
475+
component: {
476+
file: '@@/pages/TwoFactorsSetup.vue',
477+
meta: {
478+
title: 'Setup 2FA', // meta title for this page
479+
customLayout: true, // don't include default layout like menu/header
480+
//diff-add
481+
myAttribute: 'a1'
482+
}
483+
}
484+
}
485+
]
486+
```
487+
488+
To access passed meta attributes in your page, you can use `useRoute` hook:
489+
490+
```ts
491+
import { useRoute } from 'vue-router';
492+
493+
const route = useRoute();
494+
495+
console.log(route.meta.myAttribute); // a1
462496
```

0 commit comments

Comments
 (0)