From: Eduardo San Martin Morote Date: Wed, 14 Jun 2023 08:13:59 +0000 (+0200) Subject: docs: format X-Git-Tag: v4.2.3~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=957c6e7794059d43365289e194379b5963f57fa3;p=thirdparty%2Fvuejs%2Frouter.git docs: format --- 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