From 957c6e7794059d43365289e194379b5963f57fa3 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Wed, 14 Jun 2023 10:13:59 +0200 Subject: [PATCH] docs: format --- packages/docs/guide/advanced/meta.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/docs/guide/advanced/meta.md b/packages/docs/guide/advanced/meta.md index e6cf4672..7c5f045d 100644 --- a/packages/docs/guide/advanced/meta.md +++ b/packages/docs/guide/advanced/meta.md @@ -17,16 +17,16 @@ const routes = [ path: 'new', component: PostsNew, // only authenticated users can create posts - meta: { requiresAuth: true } + meta: { requiresAuth: true }, }, { path: ':id', component: PostsDetail, // anybody can read a post - meta: { requiresAuth: false } - } - ] - } + meta: { requiresAuth: false }, + }, + ], + }, ] ``` @@ -62,12 +62,13 @@ It is possible to type the meta field by extending the `RouteMeta` interface fro ```ts // This can be directly added to any of your `.ts` files like `router.ts` -// It can also be added to a `.d.ts` file, in which case you will need to add an export -// to ensure it is treated as a module -export {} - +// It can also be added to a `.d.ts` file. Make sure it's included in +// project's tsconfig.json "files" import 'vue-router' +// To ensure it is treated as a module, add at least one `export` statement +export {} + declare module 'vue-router' { interface RouteMeta { // is optional -- 2.47.2