From ab19111a825276e5ea67759827678f5eaa237336 Mon Sep 17 00:00:00 2001 From: stefanprobst Date: Thu, 1 Dec 2022 22:39:08 +0100 Subject: [PATCH] docs: use correct type names in readme (#102) [skip ci] --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9e96da62..490b3075 100644 --- a/README.md +++ b/README.md @@ -456,23 +456,23 @@ The `RouterTyped` type gives you access to the typed version of the router insta import type { RouterTyped } from 'vue-router/auto' ``` -#### `RouterLocationResolved` +#### `RouteLocationResolved` -The `RouterLocationResolved` type exposed by `vue-router/auto` allows passing a generic (which autocomplete) to type a route **whenever checking the name doesn't makes sense because you know the type**. This is useful for cases like ``: +The `RouteLocationResolved` type exposed by `vue-router/auto` allows passing a generic (which autocomplete) to type a route **whenever checking the name doesn't makes sense because you know the type**. This is useful for cases like ``: ```vue - User {{ (route as RouterLocationResolved<'/users/[id]'>).params.id }} + User {{ (route as RouteLocationResolved<'/users/[id]'>).params.id }} ``` This type is also the return type of `router.resolve()`. -You have the same equivalents for `RouterLocation`, `RouterLocationNormalized`, and `RouterLocationNormalizedLoaded`. All of them exist in `vue-router` but `vue-router/auto` override them to provide a type safe version of them. In addition to that, you can pass the name of the route as a generic: +You have the same equivalents for `RouteLocation`, `RouteLocationNormalized`, and `RouteLocationNormalizedLoaded`. All of them exist in `vue-router` but `vue-router/auto` override them to provide a type safe version of them. In addition to that, you can pass the name of the route as a generic: ```ts // these are all valid -let userWithId: RouterLocationNormalizedLoaded<'/users/[id]'> = useRoute() +let userWithId: RouteLocationNormalizedLoaded<'/users/[id]'> = useRoute() userWithId = useRoute<'/users/[id]'>() // 👇 this one is the easiest to write because it autocomplete userWithId = useRoute('/users/[id]')