Skip to content

Commit 498c2fd

Browse files
38elementseddyerburgh
authored andcommitted
docs: update docs/ja (#533)
1 parent ce9e1bf commit 498c2fd

File tree

13 files changed

+60
-23
lines changed

13 files changed

+60
-23
lines changed

docs/en/api/mount.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# `mount(component {, options}])`
1+
# `mount(component [, options])`
22

33
- **Arguments:**
44

docs/en/api/shallow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# `shallow(component {, options}])`
1+
# `shallow(component [, options])`
22

33
- **Arguments:**
44

docs/ja/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
* [マウンティングオプション](api/options.md)
2222
- [context](api/options.md#context)
2323
- [slots](api/options.md#slots)
24+
- [scopedSlots](api/options.md#scopedslots)
2425
- [stubs](api/options.md#stubs)
2526
- [mocks](api/options.md#mocks)
2627
- [localVue](api/options.md#localvue)
@@ -51,7 +52,7 @@
5152
* [setProps](api/wrapper/setProps.md)
5253
* [text](api/wrapper/text.md)
5354
* [trigger](api/wrapper/trigger.md)
54-
* [visible](api/wrapper/visible.md)
55+
* [isVisible](api/wrapper/isVisible.md)
5556
* [WrapperArray](api/wrapper-array/README.md)
5657
* [at](api/wrapper-array/at.md)
5758
* [contains](api/wrapper-array/contains.md)
@@ -65,7 +66,7 @@
6566
* [setMethods](api/wrapper-array/setMethods.md)
6667
* [setProps](api/wrapper-array/setProps.md)
6768
* [trigger](api/wrapper-array/trigger.md)
68-
* [visible](api/wrapper-array/visible.md)
69+
* [isVisible](api/wrapper-array/isVisible.md)
6970
* [コンポーネント](api/components/README.md)
7071
* [TransitionStub](api/components/TransitionStub.md)
7172
* [TransitionGroupStub](api/components/TransitionGroupStub.md)

docs/ja/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* [マウンティングオプション](api/options.md)
2020
- [context](api/options.md#context)
2121
- [slots](api/options.md#slots)
22+
- [scopedSlots](api/options.md#scopedslots)
2223
- [stubs](api/options.md#stubs)
2324
- [mocks](api/options.md#mocks)
2425
- [localVue](api/options.md#localvue)

docs/ja/api/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* [マウンティングオプション](./options.md)
88
- [context](./options.md#context)
99
- [slots](./options.md#slots)
10+
- [scopedSlots](./options.md#scopedslots)
1011
- [stubs](./options.md#stubs)
1112
- [mocks](./options.md#mocks)
1213
- [localVue](./options.md#localvue)
@@ -37,7 +38,7 @@
3738
* [setProps](./wrapper/setProps.md)
3839
* [text](./wrapper/text.md)
3940
* [trigger](./wrapper/trigger.md)
40-
* [visible](./wrapper/visible.md)
41+
* [isVisible](./wrapper/isVisible.md)
4142
* [WrapperArray](./wrapper-array/README.md)
4243
* [at](./wrapper-array/at.md)
4344
* [contains](./wrapper-array/contains.md)
@@ -51,7 +52,7 @@
5152
* [setMethods](./wrapper-array/setMethods.md)
5253
* [setProps](./wrapper-array/setProps.md)
5354
* [trigger](./wrapper-array/trigger.md)
54-
* [visible](./wrapper-array/visible.md)
55+
* [isVisible](./wrapper-array/isVisible.md)
5556
* [コンポーネント](./components/README.md)
5657
* [TransitionStub](./components/TransitionStub.md)
5758
* [TransitionGroupStub](./components/TransitionGroupStub.md)

docs/ja/api/mount.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# mount(component {, options}])
1+
# mount(component [, options])
22

33
- **引数:**
44

docs/ja/api/options.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
- [`context`](#context)
88
- [`slots`](#slots)
9+
- [`scopedSlots`](#scopedslots)
910
- [`stubs`](#stubs)
1011
- [`mocks`](#mocks)
1112
- [`localVue`](#localvue)
@@ -59,13 +60,39 @@ expect(wrapper.find('div')).toBe(true)
5960

6061
テキストを値として `slots` に渡すことはできますが、1つ制限事項があります。
6162
PhantomJS をサポートしません。
62-
[Puppeteer](https://github.com/karma-runner/karma-chrome-launcher#headless-chromium-with-puppeteer)を使用してください。
63+
代わりに [Puppeteer](https://github.com/karma-runner/karma-chrome-launcher#headless-chromium-with-puppeteer) を使用してください。
64+
65+
### `scopedSlots`
66+
67+
- 型: `{ [name: string]: string }`
68+
69+
コンポーネントにスコープ付きスロットのコンテンツのオブジェクトを渡します。key はスロット名に対応します。値はテンプレート文字列を指定します。
70+
71+
3つ制限事項があります。
72+
73+
* [email protected]+ のみをサポートします。
74+
75+
* `<template>` タグを `scopedSlots` オプションのルート要素として使用することはできません。
76+
77+
* PhantomJS をサポートしません。
78+
代わりに [Puppeteer](https://github.com/karma-runner/karma-chrome-launcher#headless-chromium-with-puppeteer) を使用してください。
79+
80+
例:
81+
82+
```js
83+
const wrapper = shallow(Component, {
84+
scopedSlots: {
85+
foo: '<p slot-scope="props">{{props.index}},{{props.text}}</p>'
86+
}
87+
})
88+
expect(wrapper.find('#fooWrapper').html()).toBe('<div id="fooWrapper"><p>0,text1</p><p>1,text2</p><p>2,text3</p></div>')
89+
```
6390

6491
### `stubs`
6592

6693
- type: `{ [name: string]: Component | boolean } | Array<string>`
6794

68-
子のコンポーネントをスタブします。スタブまたはオブジェクトに対するコンポーネント名の配列になります。`stubs` が配列の場合、すべてのスタブは `<!---->` になります。
95+
子コンポーネントをスタブします。スタブまたはオブジェクトに対するコンポーネント名の配列になります。`stubs` が配列の場合、すべてのスタブは `<!---->` になります。
6996

7097
例:
7198

docs/ja/api/shallow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# shallow(component {, options}])
1+
# shallow(component [, options])
22

33
- **引数:**
44

docs/ja/api/wrapper-array/trigger.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
# trigger(eventName)
1+
# trigger(eventName [, options])
22

33
`WrapperArray` の DOM ノードのすべての `Wrapper` でイベントを発火します。
44

55
**すべての `Wrapper` は Vue インスタンスを含んでいなければならないことに注意してください。**
66

77
- **引数:**
8-
- `{string} eventName
8+
 - `{string} eventName` **必須**
9+
 - `{Object} options` **オプション**
910

1011
- **例:**
1112

docs/ja/api/wrapper/find.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,18 @@ import Foo from './Foo.vue'
1717
import Bar from './Bar.vue'
1818

1919
const wrapper = mount(Foo)
20+
2021
const div = wrapper.find('div')
2122
expect(div.is('div')).toBe(true)
23+
2224
const bar = wrapper.find(Bar)
2325
expect(bar.is(Bar)).toBe(true)
26+
27+
const barByName = wrapper.find({ name: 'bar' })
28+
expect(barByName.is(Bar)).toBe(true)
29+
30+
const fooRef = wrapper.find({ ref: 'foo' })
31+
expect(fooRef.is(Foo)).toBe(true)
2432
```
2533

2634
- **参照:** [Wrapper](./README.md)

docs/ja/api/wrapper/trigger.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# trigger(eventName)
1+
# trigger(eventType [, options ])
22

33
`Wrapper` DOM ノードのイベントを発火します。
44

55
Triggerは `options` オブジェクト形式で行います。`options` オブジェクトのプロパティがイベントに追加されます。
66

77
- **引数:**
8-
- `{string} eventName`
9-
- `{Object} options`
8+
- `{string} eventName` **必須**
9+
- `{Object} options` **オプション**
1010

1111
- **例:**
1212

docs/ja/guides/testing-SFCs-with-jest.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,12 @@ npm install --save-dev vue-jest
4848
"transform": {
4949
// vue-jest で *.vue ファイルを処理する
5050
".*\\.(vue)$": "<rootDir>/node_modules/vue-jest"
51-
},
52-
"mapCoverage": true
51+
}
5352
}
5453
}
5554
```
5655

57-
> **注意:** `vue-jest` は現在、カスタムブロックのサポートやスタイルのロードなど、`vue-loader` のすべての機能をサポートしていません。さらに、コード分割などのWebpack固有の機能はサポートされていません。それらを使用するには、[Mocha + webpackによる単一ファイルコンポーネントのテスト](./testing-SFCs-with-mocha-webpack.md)のガイドをお読みください。
56+
> **注意:** `vue-jest` は現在、カスタムブロックのサポートやスタイルのロードなど、`vue-loader` のすべての機能をサポートしていません。さらに、コード分割などのWebpack固有の機能はサポートされていません。サポートされていない機能を使用するには、 Jest の代わりに Mocha をテストランナーとして使用します。そして、 Webpack をコンポーネントをコンパイルするために使用します。やり方は [Mocha + webpackによる単一ファイルコンポーネントのテスト](./testing-SFCs-with-mocha-webpack.md)のガイドをお読みください。
5857
5958
## Webpack エイリアスの処理
6059

@@ -158,7 +157,7 @@ Jestは、テスト対象のコードのすぐ隣に`__tests__`ディレクト
158157

159158
Jest は複数のフォーマットでカバレッジを取ることができます。 以下はそれをするための簡単な例です。
160159

161-
`jest` の設定 (普通は `package.json` か `jest.config.js`) に [collectCoverage](https://facebook.github.io/jest/docs/en/configuration.html#collectcoverage-boolean) オプションを加えます。それから、カバレッジを収集する対象のファイルを [collectCoverageFrom](https://facebook.github.io/jest/docs/en/configuration.html#collectcoveragefrom-array) に配列で定義します。 正確なカバレッジデータのために [mapCoverage](https://facebook.github.io/jest/docs/en/configuration.html#mapcoverage-boolean)`true` にします。
160+
`jest` の設定 (普通は `package.json` か `jest.config.js`) に [collectCoverage](https://facebook.github.io/jest/docs/en/configuration.html#collectcoverage-boolean) オプションを加えます。それから、カバレッジを収集する対象のファイルを [collectCoverageFrom](https://facebook.github.io/jest/docs/en/configuration.html#collectcoveragefrom-array) に配列で定義します。
162161

163162
```json
164163
{
@@ -168,8 +167,7 @@ Jest は複数のフォーマットでカバレッジを取ることができま
168167
"collectCoverageFrom": [
169168
"**/*.{js,vue}",
170169
"!**/node_modules/**"
171-
],
172-
"mapCoverage": true
170+
]
173171
}
174172
}
175173
```

docs/ja/guides/using-with-vuex.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ describe('Modules.vue', () => {
266266

267267
Vuex ストアをテストする方法が2つあります。1つ目はゲッタとミューテーションとアクションを別々に単体テストする方法です。2つ目はストアを生成してそれをテストする方法です。
268268

269-
Vuex ストアをテストする方法を説明するためにシンプルなカウンターストアを用意します。このストアには `increment` ミューテーションと `counter` ゲッタがあります。
269+
Vuex ストアをテストする方法を説明するためにシンプルなカウンターストアを用意します。このストアには `increment` ミューテーションと `evenOrOdd` ゲッタがあります。
270270

271271
```js
272272
// mutations.js
@@ -322,7 +322,7 @@ test('evenOrOdd returns even if state.count is even', () => {
322322
expect(getters.evenOrOdd(state)).toBe('even')
323323
})
324324

325-
test('evenOrOdd returns odd if state.count is even', () => {
325+
test('evenOrOdd returns odd if state.count is odd', () => {
326326
const state = {
327327
count: 1
328328
}

0 commit comments

Comments
 (0)