From 8c983ff75c8ad74f55c7adb88e7a0c73d07880c0 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Sun, 15 Oct 2017 13:51:42 +0900 Subject: [PATCH 01/17] docs: http -> https --- docs/ja/advanced/lazy-loading.md | 2 +- docs/ja/essentials/dynamic-matching.md | 2 +- docs/ja/essentials/getting-started.md | 2 +- docs/ja/essentials/nested-routes.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/ja/advanced/lazy-loading.md b/docs/ja/advanced/lazy-loading.md index 989eae137..7f0b17bc1 100644 --- a/docs/ja/advanced/lazy-loading.md +++ b/docs/ja/advanced/lazy-loading.md @@ -16,7 +16,7 @@ const Foo = () => Promise.resolve({ /* component definition */ }) import('./Foo.vue') // returns a Promise ``` -> Note: Babel を使用している場合、Babel が構文を正しく解析するために [syntax-dynamic-import](http://babeljs.io/docs/plugins/syntax-dynamic-import/) プラグインを追加する必要があります。 +> Note: Babel を使用している場合、Babel が構文を正しく解析するために [syntax-dynamic-import](https://babeljs.io/docs/plugins/syntax-dynamic-import/) プラグインを追加する必要があります。 2 つを組み合わせることで、これは、webpack によって自動的にコード分割される非同期コンポーネントを定義する方法です: diff --git a/docs/ja/essentials/dynamic-matching.md b/docs/ja/essentials/dynamic-matching.md index 36bfdd706..2b29de1bd 100644 --- a/docs/ja/essentials/dynamic-matching.md +++ b/docs/ja/essentials/dynamic-matching.md @@ -25,7 +25,7 @@ const User = { } ``` -[こちら](http://jsfiddle.net/yyx990803/4xfa2f19/) のデモの例も確認してみてください。 +[こちら](https://jsfiddle.net/yyx990803/4xfa2f19/) のデモの例も確認してみてください。 1 つのルートが複数の動的なセグメントを持つこともできます。そして、それらは `$route.params` の一致したフィールドとマップされます。例: diff --git a/docs/ja/essentials/getting-started.md b/docs/ja/essentials/getting-started.md index f3338e493..dbcf6079a 100644 --- a/docs/ja/essentials/getting-started.md +++ b/docs/ja/essentials/getting-started.md @@ -64,7 +64,7 @@ const app = new Vue({ // これで開始です! ``` -[動作](http://jsfiddle.net/yyx990803/xgrjzsup/) の例も確認してみてください. +[動作](https://jsfiddle.net/yyx990803/xgrjzsup/) の例も確認してみてください. `` は対象のルートがマッチした時に自動的に `.router-link-active` が付与されるのにお気づきでしょうか。 より詳細については [API リファレンス](../api/router-link.md) をご参照ください。 diff --git a/docs/ja/essentials/nested-routes.md b/docs/ja/essentials/nested-routes.md index 22da5c3ab..da153569a 100644 --- a/docs/ja/essentials/nested-routes.md +++ b/docs/ja/essentials/nested-routes.md @@ -95,4 +95,4 @@ const router = new VueRouter({ }) ``` -この例の動作デモは [こちら](http://jsfiddle.net/yyx990803/L7hscd8h/) です。 +この例の動作デモは [こちら](https://jsfiddle.net/yyx990803/L7hscd8h/) です。 From 521bb7e76092b4a40a61f68a3b3b59dac9bd0e34 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Sun, 15 Oct 2017 13:54:26 +0900 Subject: [PATCH 02/17] docs: tweak js string quoting NOTE: pick up from https://github.com/vuejs/vue-router/commit/7d2e60ee5bd0a830cc8b873409f134d79c128d37 --- docs/ja/essentials/history-mode.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/ja/essentials/history-mode.md b/docs/ja/essentials/history-mode.md index b3b7cfe41..bbcde335e 100644 --- a/docs/ja/essentials/history-mode.md +++ b/docs/ja/essentials/history-mode.md @@ -43,24 +43,24 @@ location / { #### Native Node.js ```js -const http = require("http") -const fs = require("fs") +const http = require('http') +const fs = require('fs') const httpPort = 80 http.createServer((req, res) => { - fs.readFile("index.htm", "utf-8", (err, content) => { + fs.readFile('index.htm', 'utf-8', (err, content) => { if (err) { console.log('We cannot open "index.htm" file.') } res.writeHead(200, { - "Content-Type": "text/html; charset=utf-8" + 'Content-Type': 'text/html; charset=utf-8' }) res.end(content) }) }).listen(httpPort, () => { - console.log("Server listening on: http://localhost:%s", httpPort) + console.log('Server listening on: http://localhost:%s', httpPort) }) ``` From 7bcff38ce958c1748d259d351f624bc754b4da17 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Sun, 15 Oct 2017 13:56:36 +0900 Subject: [PATCH 03/17] docs: pick up from https://github.com/vuejs/vue-router/commit/a5ecfa176fab33c6a9c24298a1ab5ecc6f48a628 --- docs/ja/advanced/navigation-guards.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ja/advanced/navigation-guards.md b/docs/ja/advanced/navigation-guards.md index 623c3cc16..20fca3e38 100644 --- a/docs/ja/advanced/navigation-guards.md +++ b/docs/ja/advanced/navigation-guards.md @@ -30,7 +30,7 @@ router.beforeEach((to, from, next) => { - **`next(false)`**: 現在のナビゲーションを中止します。もしブラウザのURLが変化した場合は(ユーザーが手動で変更した場合でも、戻るボタンの場合でも)、 `from` ルートのURLにリセットされます。 - - **`next('/')` または `next({ path: '/' })`**: 異なる場所へリダイレクトします。現在のナビゲーションは中止され、あたらしいナビゲーションが始まります。 + - **`next('/')` または `next({ path: '/' })`**: 異なる場所へリダイレクトします。現在のナビゲーションは中止され、あたらしいナビゲーションが始まります。You can pass any location object to `next`, which allows you to specify options like `replace: true`, `name: 'home'` and any option used in [`router-link`'s `to` prop](../api/router-link.md) or [`router.push`](../api/router-instance.md#methods) - **`next(error)`**: (2.4.0+) `next` に渡された引数が `Error` インスタンスである場合、ナビゲーションは中止され、エラーは `router.onError()` を介して登録されたコールバックに渡されます。 From dc169160180bb83050754bb899e194ee3e91d58d Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Sun, 15 Oct 2017 14:04:09 +0900 Subject: [PATCH 04/17] docs: translate previous commit --- docs/ja/advanced/navigation-guards.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ja/advanced/navigation-guards.md b/docs/ja/advanced/navigation-guards.md index 20fca3e38..2d55de206 100644 --- a/docs/ja/advanced/navigation-guards.md +++ b/docs/ja/advanced/navigation-guards.md @@ -30,7 +30,7 @@ router.beforeEach((to, from, next) => { - **`next(false)`**: 現在のナビゲーションを中止します。もしブラウザのURLが変化した場合は(ユーザーが手動で変更した場合でも、戻るボタンの場合でも)、 `from` ルートのURLにリセットされます。 - - **`next('/')` または `next({ path: '/' })`**: 異なる場所へリダイレクトします。現在のナビゲーションは中止され、あたらしいナビゲーションが始まります。You can pass any location object to `next`, which allows you to specify options like `replace: true`, `name: 'home'` and any option used in [`router-link`'s `to` prop](../api/router-link.md) or [`router.push`](../api/router-instance.md#methods) + - **`next('/')` または `next({ path: '/' })`**: 異なる場所へリダイレクトします。現在のナビゲーションは中止され、あたらしいナビゲーションが始まります。任意のロケーションオブジェクトを `next` に渡すことができます。この `next` には、`replace: true`、 `name: 'home'` のようなオプション、そして [`router-link`、`to` プロパティ](../api/router-link.md)または [`router.push`](../api/router-instance.md#methods)で使用される任意のオプションを指定することができます。 - **`next(error)`**: (2.4.0+) `next` に渡された引数が `Error` インスタンスである場合、ナビゲーションは中止され、エラーは `router.onError()` を介して登録されたコールバックに渡されます。 From 70864824b1fe2d06615513868f815a119b9bfe5d Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Sun, 15 Oct 2017 14:05:59 +0900 Subject: [PATCH 05/17] docs: pick up from https://github.com/vuejs/vue-router/commit/8f10178f50eeccd0e50ef36a2f65ba57b1f3601d --- docs/ja/essentials/redirect-and-alias.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/ja/essentials/redirect-and-alias.md b/docs/ja/essentials/redirect-and-alias.md index 88248e1ae..8185edb19 100644 --- a/docs/ja/essentials/redirect-and-alias.md +++ b/docs/ja/essentials/redirect-and-alias.md @@ -35,6 +35,8 @@ const router = new VueRouter({ }) ``` +Note that [Navigation Guards](../advanced/navigation-guards.md) are not applied on the route that redirects, only on its target. In the example below, adding a `beforeEnter` or `beforeLeave` guard to the `/a` route would not have any effect. + その他の高度な使い方として、[例](https://github.com/vuejs/vue-router/blob/dev/examples/redirect/app.js) をご参照ください。 ### エイリアス From cd48996de29f609a817302025f045fcc179eb97a Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Sun, 15 Oct 2017 14:08:50 +0900 Subject: [PATCH 06/17] docs: translate previous commit --- docs/ja/essentials/redirect-and-alias.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ja/essentials/redirect-and-alias.md b/docs/ja/essentials/redirect-and-alias.md index 8185edb19..1ea9fb351 100644 --- a/docs/ja/essentials/redirect-and-alias.md +++ b/docs/ja/essentials/redirect-and-alias.md @@ -35,7 +35,7 @@ const router = new VueRouter({ }) ``` -Note that [Navigation Guards](../advanced/navigation-guards.md) are not applied on the route that redirects, only on its target. In the example below, adding a `beforeEnter` or `beforeLeave` guard to the `/a` route would not have any effect. +[ナビゲーションガード](../advanced/navigation-guards.md)はれダイレクトするルートに提供されず、ターゲット上のみに適用されるということに注意してください。例では、`beforeEnter` または `beforeLeave` ガードを `/a` ルートに追加しても効果がありません。 その他の高度な使い方として、[例](https://github.com/vuejs/vue-router/blob/dev/examples/redirect/app.js) をご参照ください。 From 594c17a62d044090a50787ae1464653c5acef237 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Sun, 15 Oct 2017 14:10:35 +0900 Subject: [PATCH 07/17] docs: pick up from https://github.com/vuejs/vue-router/commit/91f4ad716514fdbf6258ea30a08d6168a99dd72a --- docs/ja/essentials/history-mode.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/ja/essentials/history-mode.md b/docs/ja/essentials/history-mode.md index bbcde335e..ec8de9b40 100644 --- a/docs/ja/essentials/history-mode.md +++ b/docs/ja/essentials/history-mode.md @@ -102,6 +102,24 @@ rewrite { } ``` +#### Firebase hosting + +Add this to your `firebase.json`: + +``` +{ + "hosting": { + "public": "dist", + "rewrites": [ + { + "source": "**", + "destination": "/index.html" + } + ] + } +} +``` + ## 注意 この点に関して注意があります。全ての not-found パスが `index.html` を提供するため、もはや 404 エラーをサーバーがレポートしなくなります。回避策として、Vue アプリケーション内で 404 ページを表示するために catch-all ルートを実装すべきです。 From ee3876fa8c703f43cfc518775f7658a9ec343069 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Sun, 15 Oct 2017 14:19:31 +0900 Subject: [PATCH 08/17] docs: translate previous commit --- docs/ja/essentials/history-mode.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/ja/essentials/history-mode.md b/docs/ja/essentials/history-mode.md index ec8de9b40..8eff51b4f 100644 --- a/docs/ja/essentials/history-mode.md +++ b/docs/ja/essentials/history-mode.md @@ -102,9 +102,9 @@ rewrite { } ``` -#### Firebase hosting +#### Firebase のホスティング -Add this to your `firebase.json`: +以下を `firebase.json` に追加します: ``` { From de61a6f33ef3fbdb7ec3c0c2e980dbf03940cd52 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Sun, 15 Oct 2017 14:24:37 +0900 Subject: [PATCH 09/17] docs: pick up from https://github.com/vuejs/vue-router/commit/a06e0b2ee31afd1e545458ad300057e6d2baa3f2 --- docs/ja/essentials/getting-started.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/ja/essentials/getting-started.md b/docs/ja/essentials/getting-started.md index dbcf6079a..716eb4049 100644 --- a/docs/ja/essentials/getting-started.md +++ b/docs/ja/essentials/getting-started.md @@ -64,6 +64,29 @@ const app = new Vue({ // これで開始です! ``` +By injecting the router, we get access to it as `this.$router` as well as the current route as `this.$route` inside of any component: + +```js +// Home.vue +export default { + computed: { + username () { + // We will see what `params` is shortly + return this.$route.params.username + } + }, + methods: { + goBack () { + window.history.length > 1 + ? this.$router.go(-1) + : this.$router.push('/') + } + } +} +``` + +Throughout the docs, we will often use the `router` instance. Keep in mind that `this.$router` is exactly the same as using `router`. The reason we use `this.$router` is because we don't want to import the router in every single component that needs to manipulate routing. + [動作](https://jsfiddle.net/yyx990803/xgrjzsup/) の例も確認してみてください. `` は対象のルートがマッチした時に自動的に `.router-link-active` が付与されるのにお気づきでしょうか。 From 3c7c374a63f01a4f68b002784aefb61fbbb81a97 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Sun, 15 Oct 2017 14:38:19 +0900 Subject: [PATCH 10/17] docs: translate previous commit --- docs/ja/essentials/getting-started.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/ja/essentials/getting-started.md b/docs/ja/essentials/getting-started.md index 716eb4049..f6abe57ff 100644 --- a/docs/ja/essentials/getting-started.md +++ b/docs/ja/essentials/getting-started.md @@ -64,14 +64,14 @@ const app = new Vue({ // これで開始です! ``` -By injecting the router, we get access to it as `this.$router` as well as the current route as `this.$route` inside of any component: +ルーターを注入することによって、`this.$router` と同様、任意のコンポーネント内部で現在のルートを `this.$route` としてアクセスすることができます: ```js // Home.vue export default { computed: { username () { - // We will see what `params` is shortly + // `params` が表示される return this.$route.params.username } }, @@ -85,7 +85,7 @@ export default { } ``` -Throughout the docs, we will often use the `router` instance. Keep in mind that `this.$router` is exactly the same as using `router`. The reason we use `this.$router` is because we don't want to import the router in every single component that needs to manipulate routing. +ドキュメントを通して、しばしば `router` インスタンスを使用することがよくあります。`this.$router` は `router` を使用するのと全く同じです。`this.$router` を使用する理由は、ルーティング操作する必要がある全てのコンポーネントにルーターをインポートしたくないからです。 [動作](https://jsfiddle.net/yyx990803/xgrjzsup/) の例も確認してみてください. From 2b3b65ead15bfdcfd38a3279a42fda986e1c2625 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Sun, 15 Oct 2017 14:50:38 +0900 Subject: [PATCH 11/17] docs: pick up from https://github.com/vuejs/vue-router/commit/3b16bf18532033139644e6016fb31ad27be7f667 --- docs/ja/advanced/navigation-guards.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/docs/ja/advanced/navigation-guards.md b/docs/ja/advanced/navigation-guards.md index 2d55de206..31d38c2b4 100644 --- a/docs/ja/advanced/navigation-guards.md +++ b/docs/ja/advanced/navigation-guards.md @@ -115,7 +115,28 @@ beforeRouteEnter (to, from, next) { } ``` -`beforeRouteLeave` 内で直接 `this` にアクセスすることができます。この去る際のガードは通常はユーザーが不意に編集を保存していない状態でこのルートを去ることを防ぐために使われます。このナビゲーションは `next(false)` を呼ぶことでキャンセルされます。 +Note that `beforeRouteEnter` is the only hook that supports passing a callback to `next`. For `beforeRouteUpdate` and `beforeRouteLeave`, `this` is already available, so passing a callback is unnecessary and therefore *not supported*: + +```js +beforeRouteUpdate (to, from, next) { + // just use `this` + this.name = to.params.name + next() +} +``` + +The **leave guard** is usually used to prevent the user from accidentally leaving the route with unsaved edits. The navigation can be canceled by calling `next(false)`. + +```js +beforeRouteLeave (to, from , next) { + const answer = window.confirm('Do you really want to leave? you have unsaved changes!') + if (answer) { + next() + } else { + next(false) + } +} +``` ### 完全なナビゲーション解決フロー 1. ナビゲーションがトリガされる From 02118513460a1e7c7ebd9902ec51d08f7081ea6b Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Sun, 15 Oct 2017 14:57:01 +0900 Subject: [PATCH 12/17] docs: translate previous commit --- docs/ja/advanced/navigation-guards.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/ja/advanced/navigation-guards.md b/docs/ja/advanced/navigation-guards.md index 31d38c2b4..6770f2974 100644 --- a/docs/ja/advanced/navigation-guards.md +++ b/docs/ja/advanced/navigation-guards.md @@ -115,17 +115,17 @@ beforeRouteEnter (to, from, next) { } ``` -Note that `beforeRouteEnter` is the only hook that supports passing a callback to `next`. For `beforeRouteUpdate` and `beforeRouteLeave`, `this` is already available, so passing a callback is unnecessary and therefore *not supported*: +`beforeRouteEnter` はコールバックを `next` に渡すことをサポートするだけのフックであるということに注意してください。`beforeRouteUpdate` と `beforeRouteLeave` の場合、 `this` は既に利用可能です。したがって、コールバックを渡す必要はないので、*サポートされません*: ```js beforeRouteUpdate (to, from, next) { - // just use `this` + // `this` を使用 this.name = to.params.name next() } ``` -The **leave guard** is usually used to prevent the user from accidentally leaving the route with unsaved edits. The navigation can be canceled by calling `next(false)`. +**leave ガード**は、通常、ユーザが保存されていない編集内容で誤って経路を離れるのを防ぐために使用されます。ナビゲーションは `next(false)` を呼び出すことで取り消すことができます。 ```js beforeRouteLeave (to, from , next) { From e5314861495843a808445a19702cf3a3d6122e76 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Sun, 15 Oct 2017 15:03:48 +0900 Subject: [PATCH 13/17] docs: pick up from https://github.com/vuejs/vue-router/commit/f0871d137bdb01e1ea1308cfa0a6fbb67ee6318d --- docs/ja/advanced/scroll-behavior.md | 22 ++++++++++++++++++++-- docs/ja/api/options.md | 9 +++++++-- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/docs/ja/advanced/scroll-behavior.md b/docs/ja/advanced/scroll-behavior.md index 6c1ba7c62..43c8fd2fa 100644 --- a/docs/ja/advanced/scroll-behavior.md +++ b/docs/ja/advanced/scroll-behavior.md @@ -2,9 +2,9 @@ クライアントサイドのルーティングを使っている時に、新しいルートに対してスクロールをトップへ移動させたいかもしれません、もしくは実際のページリロードがしているように history 要素のスクロールポジションを保持したいこともあるかもしれません。 `vue-router` ではこれらをさらによく実現できます。ルートナビゲーションにおけるスクロールの挙動を完全にカスタマイズすることができます。 -**注意: この機能は HTML5 history モードでのみ動作します。** +**注意: この機能は ブラウザが `history.pushState` をサポートしている場合のみ動作します。** -ルートインスタンスを作る時に、 `scrollBehavior` 関数を提供できます。 +ルーターインスタンスを作る時に、 `scrollBehavior` 関数を提供できます。 ``` js const router = new VueRouter({ @@ -61,3 +61,21 @@ scrollBehavior (to, from, savedPosition) { ``` きめの細かいスクロールの挙動コントロールを実装するために [ルートメタフィールド](meta.md) も利用可能です。詳細な例は [こちら](https://github.com/vuejs/vue-router/blob/dev/examples/scroll-behavior/app.js) をご参照ください。 + +### Async Scrolling + +> New in 2.8.0 + +You can also return a Promise that resolves to the desired position descriptor: + +``` js +scrollBehavior (to, from, savedPosition) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve({ x: 0, y: 0 }) + }, 500) + }) +} +``` + +It's possible to hook this up with events from a page-level transition component to make the scroll behavior play nicely with your page transitions, but due to the possible variance and complexity in use cases, we simply provide this primitive to enable specific userland implementations. diff --git a/docs/ja/api/options.md b/docs/ja/api/options.md index 3a635245c..0012cf81a 100644 --- a/docs/ja/api/options.md +++ b/docs/ja/api/options.md @@ -74,11 +74,16 @@ シグネチャ: ``` - ( + type PositionDescriptor = + { x: number, y: number } | + { selector: string } | + ?{} + + type scrollBehaviorHandler = ( to: Route, from: Route, savedPosition?: { x: number, y: number } - ) => { x: number, y: number } | { selector: string } | ?{} + ) => PositionDescriptor | Promise ``` より詳細については [スクロールの振る舞い](../advanced/scroll-behavior.md) を参照してください。 From e95f4f25559de55c779032d219f65b2d50190fe5 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Sun, 15 Oct 2017 15:13:28 +0900 Subject: [PATCH 14/17] docs: translate previous commit --- docs/ja/advanced/scroll-behavior.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/ja/advanced/scroll-behavior.md b/docs/ja/advanced/scroll-behavior.md index 43c8fd2fa..ffb475573 100644 --- a/docs/ja/advanced/scroll-behavior.md +++ b/docs/ja/advanced/scroll-behavior.md @@ -62,11 +62,11 @@ scrollBehavior (to, from, savedPosition) { きめの細かいスクロールの挙動コントロールを実装するために [ルートメタフィールド](meta.md) も利用可能です。詳細な例は [こちら](https://github.com/vuejs/vue-router/blob/dev/examples/scroll-behavior/app.js) をご参照ください。 -### Async Scrolling +### 非同期なスクローリング -> New in 2.8.0 +> 2.8.0 で新規 -You can also return a Promise that resolves to the desired position descriptor: +期待する位置記述子 (position descriptor) に解決されるプロミスを返すこともできます: ``` js scrollBehavior (to, from, savedPosition) { @@ -78,4 +78,4 @@ scrollBehavior (to, from, savedPosition) { } ``` -It's possible to hook this up with events from a page-level transition component to make the scroll behavior play nicely with your page transitions, but due to the possible variance and complexity in use cases, we simply provide this primitive to enable specific userland implementations. +スクロールの振る舞いをページの遷移とうまく合わせるために、ページレベルのトランジションコンポーネントからのイベントにフックすることは可能ですが、ユースケースにおいて可能性のある食い違いと複雑さのために、単純に特定のユーザランド実装を可能にするために、このプリミティブな機能を提供します。 From 250ace6342bf23283d24a26f3efa433dade37a21 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Sun, 15 Oct 2017 15:23:08 +0900 Subject: [PATCH 15/17] docs: update SUMMARY translation NOTE: pick up from https://github.com/vuejs/vue-router/commit/b7073528fd573c5b0fb5cd13d85d5d2e3395d32c --- docs/ja/SUMMARY.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/ja/SUMMARY.md b/docs/ja/SUMMARY.md index c82d8229a..17209d165 100644 --- a/docs/ja/SUMMARY.md +++ b/docs/ja/SUMMARY.md @@ -1,7 +1,7 @@ # vue-router 2 - -> 注意: vue-router@2.x は Vue 2.x のみで動作します。[0.7 のドキュメントをお探しですか?](https://github.com/vuejs/vue-router/tree/1.0/docs/ja) - + +> 注意: TypeScript ユーザ向けは、vue-router@>= 3.0 と vue@>=2.5 が必須、逆もまた同様です。 + **[リリースノート](https://github.com/vuejs/vue-router/releases)** - [インストール](installation.md) From 6fc2761ef0f5b2c308149d17b58eab353d7aea09 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Mon, 23 Oct 2017 23:23:32 +0900 Subject: [PATCH 16/17] docs: fixed translation mistaking ref: https://github.com/vuejs/vue-router/pull/1813#discussion_r146107146 --- docs/ja/advanced/navigation-guards.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ja/advanced/navigation-guards.md b/docs/ja/advanced/navigation-guards.md index 6770f2974..c0bba1ffa 100644 --- a/docs/ja/advanced/navigation-guards.md +++ b/docs/ja/advanced/navigation-guards.md @@ -115,7 +115,7 @@ beforeRouteEnter (to, from, next) { } ``` -`beforeRouteEnter` はコールバックを `next` に渡すことをサポートするだけのフックであるということに注意してください。`beforeRouteUpdate` と `beforeRouteLeave` の場合、 `this` は既に利用可能です。したがって、コールバックを渡す必要はないので、*サポートされません*: +コールバックを `next` に渡すことをサポートするのは、`beforeRouteEnter`フックだけであるということに注意してください。`beforeRouteUpdate` と `beforeRouteLeave` の場合、 `this` は既に利用可能です。したがって、コールバックを渡す必要はないので、*サポートされません*: ```js beforeRouteUpdate (to, from, next) { From 79a51db9929216701461ed59b4afb9c614312dbf Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Mon, 23 Oct 2017 23:24:28 +0900 Subject: [PATCH 17/17] docs: fixed typo --- docs/ja/essentials/redirect-and-alias.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ja/essentials/redirect-and-alias.md b/docs/ja/essentials/redirect-and-alias.md index 1ea9fb351..cd182a776 100644 --- a/docs/ja/essentials/redirect-and-alias.md +++ b/docs/ja/essentials/redirect-and-alias.md @@ -35,7 +35,7 @@ const router = new VueRouter({ }) ``` -[ナビゲーションガード](../advanced/navigation-guards.md)はれダイレクトするルートに提供されず、ターゲット上のみに適用されるということに注意してください。例では、`beforeEnter` または `beforeLeave` ガードを `/a` ルートに追加しても効果がありません。 +[ナビゲーションガード](../advanced/navigation-guards.md)はリダイレクトするルートに提供されず、ターゲット上のみに適用されるということに注意してください。例では、`beforeEnter` または `beforeLeave` ガードを `/a` ルートに追加しても効果がありません。 その他の高度な使い方として、[例](https://github.com/vuejs/vue-router/blob/dev/examples/redirect/app.js) をご参照ください。