Skip to content

translate additional docs #197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 20, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/ja/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# vue-router ドキュメンテーション [![npm package](https://img.shields.io/npm/v/vue-router.svg)](https://www.npmjs.com/package/vue-router)

**[リリースノート](https://github.com/vuejs/vue-router/releases)**

- [インストール](installation.md)
- [基本的な使い方](basic.md)
- [Nested Routes](nested.md)
Expand Down
8 changes: 8 additions & 0 deletions docs/ja/api/go.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,11 @@
```

`name` オブジェクトフォーマットについての詳細は、[Named Routes](../named.md) を参照してください。

- `path` フォーマットを使用して早退パスにナビゲートしているとき、相対パスがいつも現在のパスに**追加される**ため、`append: true` オプションに渡すことができます。例えば:

- `append: true` オプションなしで `/a` から `b` への移動は、`/b` に着きます

- `append: true` オプションありで `/a` から `b` への移動は、`/a/b` に着きます

- 両方のフォーマットも新しいものを作成するのではなく、現在の履歴エントリを置き換えるためにナビゲーションする `replace: true` オプションを受け入れます。
5 changes: 4 additions & 1 deletion docs/ja/api/redirect.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ router.redirect({

// リダイレクトは動的セグメント名がマッチする必要がある
// 動的セグメントを含むことができます
'/user/:userId': '/profile/:userId'
'/user/:userId': '/profile/:userId',

// 見つからなかったルートは /home にリダイレクト
'*': '/home'
})
```
34 changes: 30 additions & 4 deletions docs/ja/link.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,39 @@

#### アクティブリンククラス

`v-link` を利用する要素で、現在のパスが `v-link` の URL にマッチするとき、自動的に対応するクラス名を取得します:
`v-link` を利用する要素で、現在のパスが `v-link` の URL にマッチするとき、自動的に対応するクラス名を取得します。適用されるデフォルトクラスは、`.v-link-active` で、デフォルトのマッチングの振舞いは、**包括一致 (inclusive match)** です。例えば、`v-link="/a"` による要素は、`/a` で現在のパスが開始する限り、このクラスに適用されるでしょう。

- `.v-link-active` クラスは、現在のパスが `v-link` の URL で開始するとき、要素に適用されます。例えば、`v-link="/a"` による要素は、現在のパスが `/a` で開始する限り、このクラスを取得します。
`exact` インラインオプションを使用してパスが正確に一致するとき、アクティブクラスのみ適用されるマッチングの動作を設定することも可能です:

- `.v-link-active-exact` クラスは、現在のパスが `v-link` の URL の正確にマッチするとき、適用されます。
``` html
<a v-link="{ path: '/a', exact: true }"></a>
```

アクティブリンククラス名は、ルーターインスタンスを作成しているとき、`linkActiveClass` オプションで設定することができます。`activeClass` インラインオプションで上書きすることもできます:

``` html
<a v-link="{ path: '/a', activeClass: 'custom-active-class' }"></a>
```

#### 他の設定オプション

- **replace**

`replace: true` によるリンクは、ナビゲーションが履歴レコードから離れないため、クリックしたとき `router.go()` の代わりに `router.replace()` を呼び出します。

``` html
<a v-link="{ path: '/abc', replace: true }"></a>
```

- **append**

`append: true` による相対リンクは、常に現在のパスに相対パスを追加します。例えば、我々が `/a` から相対リンク `b` に移動していると仮定すると、`append: true` なしで、我々は `b` で終わりますが、`append: true` ありでは、我々は `/a/b` で終わります。

アクティブリンククラス名は、ルーターインスタンスを作成しているとき、`linkActiveClass` オプションで設定することができます。完全に一致するクラスは、提供されるクラス名に `-exact` 接尾辞 を単に追加することになります。

アクティブリンククラス名はルーターインスタンスを作成するとき、`linkActiveClass` オプションで設定することができます。正確にマッチするクラスは、単に提供されたクラス名に `-exact` 接尾辞(postfix) を追加します。
``` html
<a v-link="{ path: 'relative/path', append: true }"></a>
```

#### その他の注意事項

Expand Down
2 changes: 1 addition & 1 deletion docs/ja/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

- デフォルト: `"v-link-active"`

現在のパスがその URL とマッチするとき、クラスは `v-link` 要素に適用されるように設定します。基底クラスは、現在のパスが `v-link` の URL で開始する限り適用されます。現在のパスが正確に `v-link` の URL にマッチするとき、`-exact` 接尾辞(postfix) を持つ追加のクラスが適用され、デフォルトは `v-link-active-exact` になります。もしクラスを `my-custom-active` に設定する場合、正確にマッチするクラスは `my-custom-active-exact` になります
現在のリンクがアクティブであるとき、クラスは `v-link` 要素に適用されるように設定します。マッチングの振る舞いとクラスは、個別に各 `v-link` に構成することができます

#### saveScrollPosition

Expand Down
2 changes: 1 addition & 1 deletion docs/ja/pipeline/activate.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

フックを解決するために `transition.next()` を呼び出します。ここで `transition.abort()` を呼び出すと、トランジションは既に検証されているため、アプリケーションは以前のルートへ戻りません。

### 戻り値
### 期待される戻り値

- 任意で Promise を返します。
- `resolve` -> `transition.next()`
Expand Down
3 changes: 2 additions & 1 deletion docs/ja/pipeline/can-activate.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@

フックを解決するために、`transition.next()` を呼び出します。`transition.abort()` を呼び出すと無効となり、トランジションをキャンセルします。

### 戻り値
### 期待される戻り値

- 任意で Promise を返します。

- `resolve(true)` -> `transition.next()`
- `resolve(false)` -> `transition.abort()`
- `reject(reason)` -> `transition.abort(reason)`


- 任意で Boolean を返します。

- `true` -> `transition.next()`
Expand Down
3 changes: 2 additions & 1 deletion docs/ja/pipeline/can-deactivate.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@

フックを解決するために、`transition.next()` を呼び出します。`transition.abort()` を呼び出すと無効となり、トランジションをキャンセルします。

### 戻り値
### 期待される戻り値

- 任意で Promise を返します。

- `resolve(true)` -> `transition.next()`
- `resolve(false)` -> `transition.abort()`
- `reject(reason)` -> `transition.abort(reason)`


- 任意で Boolean を返します。

- `true` -> `transition.next()`
Expand Down
2 changes: 1 addition & 1 deletion docs/ja/pipeline/can-reuse.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

`canResue` フックでは `transition.to` と `transition.from` のみアクセスできます。

### 戻り値
### 期待される戻り値

- Boolean を返す必要があります。偽となりうる値は、`false` として扱われます。

Expand Down
4 changes: 2 additions & 2 deletions docs/ja/pipeline/data.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

`transition.next(data)` の呼び出しはコンポーネントの `data` の各プロパティに設定します。例えば `{ a: 1, b: 2 }` が引数に指定される場合、ルーターは `component.$set('a', 1)` と `component.$set('b', 2)` を呼びます。

### 戻り値
### 期待される戻り値

- 任意で Promise を返します。
- `resolve(data)` -> `transition.next(data)`
- `reject(reason)` -> `transition.abort(reason)`

または、Promise を含んでいるオブジェクトを返します。詳細は以下の [Promiseシンタックスシュガー](#Promiseシンタックスシュガー) を参照してください。
**または**、Promise を含んでいるオブジェクトを返します。詳細は以下の [Promiseシンタックスシュガー](#Promiseシンタックスシュガー) を参照してください。

### 詳細

Expand Down
2 changes: 1 addition & 1 deletion docs/ja/pipeline/deactivate.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

フックを解決するために `transition.next()` を呼び出します。ここで `transition.abort()` を呼び出すと、トランジションは既に検証されているため、アプリケーションは以前のルートへ戻りません。

### 戻り値
### 期待される戻り値

- 任意で Promise を返します。
- `resolve` -> `transition.next()`
Expand Down
14 changes: 13 additions & 1 deletion docs/ja/pipeline/hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,16 @@ route: {
}
```

vue-router レポジトリの [advanced example](https://github.com/vuejs/vue-router/tree/dev/example/advanced) をチェックしてください。
アクションのトランジションフックの完全な例については、vue-router レポジトリの [advanced example](https://github.com/vuejs/vue-router/tree/dev/example/advanced) をチェックしてください。

### フックのマージ

コンポーネントライフサイクルのフックと同様に、以下の route ライフサイクルフックは:

- `data`
- `activate`
- `deactivate`

... クラス拡張またはミックスインがマージされるまでの間、あなたのコンポーネントが route `data` フックを定義する場合は、route `data` フックも提供するミックスインを使用し、両方のフックが(ミックスインのフックが最初に呼ばれる)呼ばれて、全てのフックから解決されたデータはいっしょにマージされます。

`canActivate`、`canDeactivate`、そして `canReuse` のような検証フックは、常に新しい値によって上書きされることに注意してください。
4 changes: 4 additions & 0 deletions docs/ja/route.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ route オブジェクトは以下のプロパティを公開します:

この route (そしてそのオーナー自身のコンポーネント) を管理しているルーターインスタンス。

- **$route.matched**

現在の route で全てマッチされたセグメントに対する route 設定オブジェクトを含んでいる配列。

### カスタムフィールド

上記のビルドインプロパティに加えて、route 設定で定義されたカスタムフィールドも、route オブジェクトにマージされます。例:
Expand Down
2 changes: 1 addition & 1 deletion docs/ja/view.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@

しかしながら、いくつか制限があります:

- `keep-alive` は現在サポートされていません。
- ~~`keep-alive` は現在サポートされていません。~~ `keep-alive` は現在 0.7.2+ で実験的にサポートしています
- `wait-for` はサポートされていません。トランジションのタイミングを制御するためには [`activate` transition hook](pipeline/activate.html) を使用する必要があります。