Skip to content

Commit 98e9af6

Browse files
committed
docs: reorder example
1 parent e4c0a54 commit 98e9af6

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

netlify.toml

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[build.environment]
22
CHROMEDRIVER_SKIP_DOWNLOAD = "true"
3+
NODE_VERSION = "18"
34

45
[build]
56
command = "pnpm run docs:build"

packages/docs/api/interfaces/Router.md

+8
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ function that removes the registered hook.
100100

101101
`fn`
102102

103+
a function that removes the registered hook
104+
103105
▸ (): `void`
104106

105107
Add a navigation hook that is executed after every navigation. Returns a
@@ -109,6 +111,8 @@ function that removes the registered hook.
109111

110112
`void`
111113

114+
a function that removes the registered hook
115+
112116
**`Example`**
113117

114118
```js
@@ -191,6 +195,8 @@ registered guard.
191195

192196
`fn`
193197

198+
a function that removes the registered guard
199+
194200
▸ (): `void`
195201

196202
Add a navigation guard that executes before navigation is about to be
@@ -202,6 +208,8 @@ registered guard.
202208

203209
`void`
204210

211+
a function that removes the registered guard
212+
205213
**`Example`**
206214

207215
```js

packages/router/src/errors.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ export function createRouterError<E extends RouterError>(
144144
/**
145145
* Check if an object is a {@link NavigationFailure}.
146146
*
147+
* @param error - possible {@link NavigationFailure}
148+
* @param type - optional types to check for
149+
*
147150
* @example
148151
* ```js
149152
* import { isNavigationFailure, NavigationFailureType } from 'vue-router'
@@ -163,8 +166,6 @@ export function createRouterError<E extends RouterError>(
163166
* }
164167
* })
165168
* ```
166-
* @param error - possible {@link NavigationFailure}
167-
* @param type - optional types to check for
168169
*/
169170
export function isNavigationFailure(
170171
error: any,

packages/router/src/router.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -287,20 +287,26 @@ export interface Router {
287287
* navigation guards have been successful. Returns a function that removes the
288288
* registered guard.
289289
*
290+
* @param guard - navigation guard to add
291+
* @returns a function that removes the registered guard
292+
*
290293
* @example
291294
* ```js
292295
* router.beforeResolve(to => {
293296
* if (to.meta.requiresAuth && !isAuthenticated) return false
294297
* })
295298
* ```
296299
*
297-
* @param guard - navigation guard to add
298300
*/
299301
beforeResolve(guard: NavigationGuardWithThis<undefined>): () => void
302+
300303
/**
301304
* Add a navigation hook that is executed after every navigation. Returns a
302305
* function that removes the registered hook.
303306
*
307+
* @param guard - navigation hook to add
308+
* @returns a function that removes the registered hook
309+
*
304310
* @example
305311
* ```js
306312
* router.afterEach((to, from, failure) => {
@@ -309,8 +315,6 @@ export interface Router {
309315
* }
310316
* })
311317
* ```
312-
*
313-
* @param guard - navigation hook to add
314318
*/
315319
afterEach(guard: NavigationHookAfter): () => void
316320

0 commit comments

Comments
 (0)