Skip to content

Commit 3984871

Browse files
committed
translate vue-router using section
1 parent 12693cb commit 3984871

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

docs/ja/guides/using-with-vue-router.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Using with vue-router
1+
# Vue Router と一緒に使用する
22

3-
## Installing vue-router in tests
3+
## テストへ Vue Router のインストール
44

5-
You should never install vue-router on the Vue base constructor in tests. Installing vue-router adds `$route` and `$router` as read-only properties on Vue prototype.
5+
テストで Vue のコンストラクタベースの Vue Router をインストールしないでください。Vue Router をインストールすると Vue のプロトタイプの読み取り専用プロパティとして `$route` `$router` が追加されます。
66

7-
To avoid this, we can create a localVue, and install vue-router on that.
7+
これを回避するために、localeVue を作成し、その上に Vue Router をインストールすることができます。
88

99
```js
1010
import VueRouter from 'vue-router'
@@ -17,21 +17,21 @@ shallow(Component, {
1717
})
1818
```
1919

20-
## Testing components that use router-link or router-view
20+
## router-link または router-view を使用するコンポーネントテスト
2121

22-
When you install vue-router, the router-link and router-view components are registered. This means we can use them anywhere in our application without needing to import them.
22+
Vue Router をインストールする時、router-link router-view コンポーネントが登録されます。これは、それらをアプリケーションにインポートする必要がなく、アプリケーションのどこでも使用することができます。
2323

24-
When we run tests, we need to make these vue-router components available to the component we're mounting. There are two methods to do this.
24+
テストを実行する際には、マウントしているコンポーネントにこれら Vue Router のコンポーネントを使用できるようにする必要があります。これらを行うには 2 つの方法があります。
2525

26-
### Using stubs
26+
### スタブを使用する
2727

2828
```js
2929
shallow(Component, {
3030
stubs: ['router-link', 'router-view']
3131
})
3232
```
3333

34-
### Installing vue-router with localVue
34+
### localVue による Vue Router のインストール
3535

3636
```js
3737
import VueRouter from 'vue-router'
@@ -44,9 +44,9 @@ shallow(Component, {
4444
})
4545
```
4646

47-
## Mocking $route and $router
47+
## $route $router のモック
4848

49-
Sometimes you want to test that a component does something with parameters from the `$route` and `$router` objects. To do that, you can pass custom mocks to the Vue instance.
49+
時々、コンポーネントが `$route` `$router` オブジェクトから引数によって何かをするテストをしたいときがあります。これをするためには、Vue インスタンスにカスタムモックを渡すことができます。
5050

5151
```js
5252
const $route = {
@@ -62,10 +62,10 @@ const wrapper = shallow(Component, {
6262
wrapper.vm.$router // /some/path
6363
```
6464

65-
## Common gotchas
65+
## よくある落とし穴
6666

67-
Installing vue-router adds `$route` and `$router` as read-only properties on Vue prototype.
67+
Vue Router をインストールすると Vue のプロトタイプに読み取り専用プロパティとして `$route` `$router` が追加されます。
6868

69-
This means any future tests that try to mock $route or `$router` will fail.
69+
これは、`$route` または `$router` をモックを試みるテストが将来失敗することを意味します。
7070

71-
To avoid this, never install vue-router when you're running tests.
71+
これを回避するために、テストを実行するときに、Vue Router をインストールしないでください。

0 commit comments

Comments
 (0)