Skip to content

Commit 7b28af6

Browse files
38elementseddyerburgh
authored andcommitted
docs: update docs/ja (#841)
1 parent b6a3659 commit 7b28af6

File tree

7 files changed

+83
-4
lines changed

7 files changed

+83
-4
lines changed

docs/ja/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@
6565
* [is](api/wrapper-array/is.md)
6666
* [isEmpty](api/wrapper-array/isEmpty.md)
6767
* [isVueInstance](api/wrapper-array/isVueInstance.md)
68+
* [setChecked](api/wrapper-array/setChecked.md)
6869
* [setData](api/wrapper-array/setData.md)
6970
* [setMethods](api/wrapper-array/setMethods.md)
7071
* [setProps](api/wrapper-array/setProps.md)
72+
* [setValue](api/wrapper-array/setValue.md)
7173
* [trigger](api/wrapper-array/trigger.md)
7274
* [isVisible](api/wrapper-array/isVisible.md)
7375
* [コンポーネント](api/components/)

docs/ja/api/config.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ vue-test-utils にはオプションを定義するための `config` オプシ
66

77
#### `stubs`
88

9-
- 型: `Object`
9+
- 型: `{ [name: string]: Component | boolean | string }`
1010
- デフォルト: `{
1111
transition: TransitionStub,
1212
'transition-group': TransitionGroupStub
@@ -45,7 +45,7 @@ VueTestUtils.config.mocks['$store'] = {
4545

4646
#### `methods`
4747

48-
- 型: `Object`
48+
- 型: `{ [name: string]: Function }`
4949
- デフォルト: `{}`
5050

5151
`config` オブジェクトを使用してデフォルトのメソッドを設定することができます。これは [VeeValidate](https://vee-validate.logaretm.com/) のようなコンポーネントにメソッドを注入するプラグインに役立ちます。`config` にセットした methods はマウンティングオプションに `methods` を渡すことで上書きすることができます。

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

+2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
!!!include(docs/ja/api/wrapper-array/is.md)!!!
2222
!!!include(docs/ja/api/wrapper-array/isEmpty.md)!!!
2323
!!!include(docs/ja/api/wrapper-array/isVueInstance.md)!!!
24+
!!!include(docs/ja/api/wrapper-array/setChecked.md)!!!
2425
!!!include(docs/ja/api/wrapper-array/setData.md)!!!
2526
!!!include(docs/ja/api/wrapper-array/setMethods.md)!!!
2627
!!!include(docs/ja/api/wrapper-array/setProps.md)!!!
28+
!!!include(docs/ja/api/wrapper-array/setValue.md)!!!
2729
!!!include(docs/ja/api/wrapper-array/trigger.md)!!!
+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
## setChecked(checked)
2+
3+
このメソッドは以下のコードのエイリアスです。
4+
5+
```js
6+
wrapperArray.wrappers.forEach(wrapper => wrapper.setChecked(checked))
7+
```
8+
9+
- **引数:**
10+
- `{Boolean} checked (デフォルト: true)`
11+
12+
- **例:**
13+
14+
```js
15+
import { mount } from '@vue/test-utils'
16+
17+
const wrapper = mount({
18+
data () {
19+
return {
20+
t1: false,
21+
t2: ''
22+
}
23+
},
24+
template: `
25+
<div>
26+
<input type="checkbox" name="t1" class="foo" v-model="t1" />
27+
<input type="radio" name="t2" class="foo" value="foo" v-model="t2"/>
28+
<input type="radio" name="t2" class="bar" value="bar" v-model="t2"/>
29+
</div>`
30+
})
31+
32+
const wrapperArray = wrapper.findAll('.foo')
33+
expect(wrapper.vm.t1).to.equal(false)
34+
expect(wrapper.vm.t2).to.equal('')
35+
wrapperArray.setChecked()
36+
expect(wrapper.vm.t1).to.equal(true)
37+
expect(wrapper.vm.t2).to.equal('foo')
38+
```

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

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## setValue(value)
2+
3+
このメソッドは以下のコードのエイリアスです。
4+
5+
```js
6+
wrapperArray.wrappers.forEach(wrapper => wrapper.setValue(value))
7+
```
8+
9+
- **引数:**
10+
- `{any} value`
11+
12+
- **例:**
13+
14+
```js
15+
import { mount } from '@vue/test-utils'
16+
17+
const wrapper = mount({
18+
data () {
19+
return {
20+
t1: '',
21+
t2: ''
22+
}
23+
},
24+
template: `
25+
<div>
26+
<input type="text" name="t1" class="foo" v-model="t1" />
27+
<input type="text" name="t2" class="foo" v-model="t2"/>
28+
</div>`
29+
})
30+
31+
const wrapperArray = wrapper.findAll('.foo')
32+
expect(wrapper.vm.t1).to.equal('')
33+
expect(wrapper.vm.t2).to.equal('')
34+
wrapperArray.setValue('foo')
35+
expect(wrapper.vm.t1).to.equal('foo')
36+
expect(wrapper.vm.t2).to.equal('foo')
37+
```

docs/ja/api/wrapper/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ vue-test-utils はラッパベースの API です。
88

99
### `vm`
1010

11-
`Component` (読み込み専用):これは vue のインスタンスです。`wrapper.vm` を使って [vm のプロパティとインスタンスメソッド](https://jp.vuejs.org/v2/api/#インスタンスプロパティ)にアクセスできます。これは、Vue コンポーネントラッパにのみ存在します
11+
`Component` (読み込み専用):これは vue のインスタンスです。`wrapper.vm` を使って [vm のプロパティとインスタンスメソッド](https://jp.vuejs.org/v2/api/#インスタンスプロパティ)にアクセスできます。これは、Vue コンポーネントのラッパもしくは Vue コンポーネントをバインディングしている HTMLElement のラッパにのみ存在します
1212

1313
### `element`
1414

docs/ja/api/wrapper/setValue.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
text コントロールの input 要素の 値をセットします。そして、 `v-model` に束縛されているデータを更新します。
44

55
- **引数:**
6-
- `{String} value`
6+
- `{any} value`
77

88
- **例:**
99

0 commit comments

Comments
 (0)