Skip to content

Commit

Permalink
docs(zh): translate api interfaces (#1821)
Browse files Browse the repository at this point in the history
* docs(zh): translate api interfaces

* Update Router.md

* Apply suggestions from code review

Co-authored-by: wxsm <wxsms@foxmail.com>

---------

Co-authored-by: wxsm <wxsms@foxmail.com>
  • Loading branch information
Jinjiang and wxsms authored May 16, 2023
1 parent 7505b5b commit 9ea7052
Show file tree
Hide file tree
Showing 20 changed files with 284 additions and 313 deletions.
2 changes: 1 addition & 1 deletion packages/docs/zh/api/enums/NavigationFailureType.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
editLink: false
---

[API Documentation](../index.md) / NavigationFailureType
[API 参考](../index.md) / NavigationFailureType

# 枚举:NavigationFailureType %{#enumeration-navigationfailuretype}%

Expand Down
2 changes: 1 addition & 1 deletion packages/docs/zh/api/interfaces/HistoryState.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
editLink: false
---

[API Documentation](../index.md) / HistoryState
[API 参考](../index.md) / HistoryState

# 接口:HistoryState %{#interface-historystate}%

Expand Down
6 changes: 3 additions & 3 deletions packages/docs/zh/api/interfaces/NavigationFailure.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
editLink: false
---

[API Documentation](../index.md) / NavigationFailure
[API 参考](../index.md) / NavigationFailure

# 接口:NavigationFailure %{#interface-navigationfailure}%

Expand Down Expand Up @@ -68,12 +68,12 @@ ___

**to**: [`RouteLocationNormalized`](RouteLocationNormalized.md)

Route location we were navigating to
要导航至的下一个路由位置

___

### type %{#Properties-type}%

**type**: `NAVIGATION_ABORTED` \| `NAVIGATION_CANCELLED` \| `NAVIGATION_DUPLICATED`

Type of the navigation. One of [NavigationFailureType](../enums/NavigationFailureType.md)
导航类型。属于 [NavigationFailureType](../enums/NavigationFailureType.md) 的一种。
15 changes: 7 additions & 8 deletions packages/docs/zh/api/interfaces/NavigationGuard.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,26 @@
editLink: false
---

[API Documentation](../index.md) / NavigationGuard
[API 参考](../index.md) / NavigationGuard

# Interface: NavigationGuard
# 接口:NavigationGuard %{#interface-navigationguard}%

## Callable %{#Callable}%
## 可调用函数 %{#Callable}%

### NavigationGuard %{#Callable-NavigationGuard}%

**NavigationGuard**(`to`, `from`, `next`): `NavigationGuardReturn` \| `Promise`<`NavigationGuardReturn`\>

Navigation guard. See [Navigation
Guards](/guide/advanced/navigation-guards.md).
导航守卫。详情可查阅[导航守卫](/zh/guide/advanced/navigation-guards.md).

#### Parameters %{#Callable-NavigationGuard-Parameters}%
#### 参数 %{#Callable-NavigationGuard-Parameters}%

| Name | Type |
| 名称 | 类型 |
| :------ | :------ |
| `to` | [`RouteLocationNormalized`](RouteLocationNormalized.md) |
| `from` | [`RouteLocationNormalized`](RouteLocationNormalized.md) |
| `next` | [`NavigationGuardNext`](NavigationGuardNext.md) |

#### Returns %{#Callable-NavigationGuard-Returns}%
#### 返回值 %{#Callable-NavigationGuard-Returns}%

`NavigationGuardReturn` \| `Promise`<`NavigationGuardReturn`\>
32 changes: 16 additions & 16 deletions packages/docs/zh/api/interfaces/NavigationGuardNext.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,72 +2,72 @@
editLink: false
---

[API Documentation](../index.md) / NavigationGuardNext
[API 参考](../index.md) / NavigationGuardNext

# Interface: NavigationGuardNext
# 接口:NavigationGuardNext %{#interface-navigationguardnext}%

## Callable %{#Callable}%
## 可调用函数 %{#Callable}%

### NavigationGuardNext %{#Callable-NavigationGuardNext}%

**NavigationGuardNext**(): `void`

#### Returns %{#Callable-NavigationGuardNext-Returns}%
#### 返回值 %{#Callable-NavigationGuardNext-Returns}%

`void`

### NavigationGuardNext %{#Callable-NavigationGuardNext_1}%

**NavigationGuardNext**(`error`): `void`

#### Parameters %{#Callable-NavigationGuardNext-Parameters}%
#### 参数 %{#Callable-NavigationGuardNext-Parameters}%

| Name | Type |
| 名称 | 类型 |
| :------ | :------ |
| `error` | `Error` |

#### Returns %{#Callable-NavigationGuardNext-Returns_1}%
#### 返回值 %{#Callable-NavigationGuardNext-Returns_1}%

`void`

### NavigationGuardNext %{#Callable-NavigationGuardNext_2}%

**NavigationGuardNext**(`location`): `void`

#### Parameters %{#Callable-NavigationGuardNext-Parameters_1}%
#### 参数 %{#Callable-NavigationGuardNext-Parameters_1}%

| Name | Type |
| 名称 | 类型 |
| :------ | :------ |
| `location` | [`RouteLocationRaw`](../index.md#routelocationraw) |

#### Returns %{#Callable-NavigationGuardNext-Returns_2}%
#### 返回值 %{#Callable-NavigationGuardNext-Returns_2}%

`void`

### NavigationGuardNext %{#Callable-NavigationGuardNext_3}%

**NavigationGuardNext**(`valid`): `void`

#### Parameters %{#Callable-NavigationGuardNext-Parameters_2}%
#### 参数 %{#Callable-NavigationGuardNext-Parameters_2}%

| Name | Type |
| 名称 | 类型 |
| :------ | :------ |
| `valid` | `undefined` \| `boolean` |

#### Returns %{#Callable-NavigationGuardNext-Returns_3}%
#### 返回值 %{#Callable-NavigationGuardNext-Returns_3}%

`void`

### NavigationGuardNext %{#Callable-NavigationGuardNext_4}%

**NavigationGuardNext**(`cb`): `void`

#### Parameters %{#Callable-NavigationGuardNext-Parameters_3}%
#### 参数 %{#Callable-NavigationGuardNext-Parameters_3}%

| Name | Type |
| 名称 | 类型 |
| :------ | :------ |
| `cb` | `NavigationGuardNextCallback` |

#### Returns %{#Callable-NavigationGuardNext-Returns_4}%
#### 返回值 %{#Callable-NavigationGuardNext-Returns_4}%

`void`
17 changes: 8 additions & 9 deletions packages/docs/zh/api/interfaces/NavigationGuardWithThis.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,33 @@
editLink: false
---

[API Documentation](../index.md) / NavigationGuardWithThis
[API 参考](../index.md) / NavigationGuardWithThis

# Interface: NavigationGuardWithThis<T\>
# 接口:NavigationGuardWithThis<T\> %{#interface-navigationguardwiththis-t}%

## Type parameters %{#Type-parameters}%
## 类型参数 %{#Type-parameters}%

| Name |
| :------ |
| `T` |

## Callable %{#Callable}%
## 可调用函数 %{#Callable}%

### NavigationGuardWithThis %{#Callable-NavigationGuardWithThis}%

**NavigationGuardWithThis**(`this`, `to`, `from`, `next`): `NavigationGuardReturn` \| `Promise`<`NavigationGuardReturn`\>

Navigation guard. See [Navigation
Guards](/guide/advanced/navigation-guards.md).
导航守卫。详情可查阅[导航守卫](/zh/guide/advanced/navigation-guards.md).

#### Parameters %{#Callable-NavigationGuardWithThis-Parameters}%
#### 参数 %{#Callable-NavigationGuardWithThis-Parameters}%

| Name | Type |
| 名称 | 类型 |
| :------ | :------ |
| `this` | `T` |
| `to` | [`RouteLocationNormalized`](RouteLocationNormalized.md) |
| `from` | [`RouteLocationNormalized`](RouteLocationNormalized.md) |
| `next` | [`NavigationGuardNext`](NavigationGuardNext.md) |

#### Returns %{#Callable-NavigationGuardWithThis-Returns}%
#### 返回值 %{#Callable-NavigationGuardWithThis-Returns}%

`NavigationGuardReturn` \| `Promise`<`NavigationGuardReturn`\>
12 changes: 6 additions & 6 deletions packages/docs/zh/api/interfaces/NavigationHookAfter.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
editLink: false
---

[API Documentation](../index.md) / NavigationHookAfter
[API 参考](../index.md) / NavigationHookAfter

# Interface: NavigationHookAfter
# 接口:NavigationHookAfter %{#interface-navigationhookafter}%

## Callable %{#Callable}%
## 可调用函数 %{#Callable}%

### NavigationHookAfter %{#Callable-NavigationHookAfter}%

**NavigationHookAfter**(`to`, `from`, `failure?`): `any`

#### Parameters %{#Callable-NavigationHookAfter-Parameters}%
#### 参数 %{#Callable-NavigationHookAfter-Parameters}%

| Name | Type |
| 名称 | 类型 |
| :------ | :------ |
| `to` | [`RouteLocationNormalized`](RouteLocationNormalized.md) |
| `from` | [`RouteLocationNormalized`](RouteLocationNormalized.md) |
| `failure?` | `void` \| [`NavigationFailure`](NavigationFailure.md) |

#### Returns %{#Callable-NavigationHookAfter-Returns}%
#### 返回值 %{#Callable-NavigationHookAfter-Returns}%

`any`
48 changes: 22 additions & 26 deletions packages/docs/zh/api/interfaces/RouteLocation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,27 @@
editLink: false
---

[API Documentation](../index.md) / RouteLocation
[API 参考](../index.md) / RouteLocation

# Interface: RouteLocation
# 接口:RouteLocation %{#interface-routelocation}%

[RouteLocationRaw](../index.md#routelocationraw) resolved using the matcher
通过匹配解析出来的 [RouteLocationRaw](../index.md#routelocationraw)

## Hierarchy %{#Hierarchy}%
## 继承关系 %{#Hierarchy}%

- `_RouteLocationBase`

**`RouteLocation`**

## Properties %{#Properties}%
## 属性 %{#Properties}%

### fullPath %{#Properties-fullPath}%

**fullPath**: `string`

The whole location including the `search` and `hash`. This string is
percentage encoded.
包括 `search``hash` 在内的完整地址。该字符串是经过百分号编码的。

#### Inherited from %{#Properties-fullPath-Inherited-from}%
#### 继承自 %{#Properties-fullPath-Inherited-from}%

\_RouteLocationBase.fullPath

Expand All @@ -33,9 +32,9 @@ ___

**hash**: `string`

Hash of the current location. If present, starts with a `#`.
当前地址的 hash。如果存在则以 `#` 开头。

#### Inherited from %{#Properties-hash-Inherited-from}%
#### 继承自 %{#Properties-hash-Inherited-from}%

\_RouteLocationBase.hash

Expand All @@ -45,19 +44,17 @@ ___

**matched**: [`RouteRecordNormalized`](RouteRecordNormalized.md)[]

Array of [RouteRecord](../index.md#routerecord) containing components as they were
passed when adding records. It can also contain redirect records. This
can't be used directly
包含添加记录时被传入的 [RouteRecord](../index.md#routerecord) 的数组。它也可以包含重定向记录。不能直接使用。

___

### meta %{#Properties-meta}%

**meta**: [`RouteMeta`](RouteMeta.md)

Merged `meta` properties from all the matched route records.
从所有匹配的路由记录中合并的 `meta` 属性。

#### Inherited from %{#Properties-meta-Inherited-from}%
#### 继承自 %{#Properties-meta-Inherited-from}%

\_RouteLocationBase.meta

Expand All @@ -67,9 +64,9 @@ ___

**name**: `undefined` \| ``null`` \| [`RouteRecordName`](../index.md#routerecordname)

Name of the matched record
匹配的路由名称。

#### Inherited from %{#Properties-name-Inherited-from}%
#### 继承自 %{#Properties-name-Inherited-from}%

\_RouteLocationBase.name

Expand All @@ -79,9 +76,9 @@ ___

**params**: [`RouteParams`](../index.md#routeparams)

Object of decoded params extracted from the `path`.
`path` 中提取出来并解码后的参数对象。

#### Inherited from %{#Properties-params-Inherited-from}%
#### 继承自 %{#Properties-params-Inherited-from}%

\_RouteLocationBase.params

Expand All @@ -91,9 +88,9 @@ ___

**path**: `string`

Percentage encoded pathname section of the URL.
经过百分号编码的 URL 中的 pathname 段。

#### Inherited from %{#Properties-path-Inherited-from}%
#### 继承自 %{#Properties-path-Inherited-from}%

\_RouteLocationBase.path

Expand All @@ -103,9 +100,9 @@ ___

**query**: [`LocationQuery`](../index.md#locationquery)

Object representation of the `search` property of the current location.
代表当前地址的 `search` 属性的对象

#### Inherited from %{#Properties-query-Inherited-from}%
#### 继承自 %{#Properties-query-Inherited-from}%

\_RouteLocationBase.query

Expand All @@ -115,9 +112,8 @@ ___

**redirectedFrom**: `undefined` \| [`RouteLocation`](RouteLocation.md)

Contains the location we were initially trying to access before ending up
on the current location.
包含在重定向到当前地址之前,我们最初想访问的地址。

#### Inherited from %{#Properties-redirectedFrom-Inherited-from}%
#### 继承自 %{#Properties-redirectedFrom-Inherited-from}%

\_RouteLocationBase.redirectedFrom
Loading

0 comments on commit 9ea7052

Please sign in to comment.