Skip to content

Commit 87936e9

Browse files
Jinjiangeddyerburgh
authored andcommitted
docs: keep update (#702)
1 parent bcad00b commit 87936e9

File tree

10 files changed

+67
-10
lines changed

10 files changed

+67
-10
lines changed

Diff for: docs/api/wrapper/setChecked.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## setChecked(value)
22

3-
Sets the value of a radio or checkbox `<input`>.
3+
Sets the value of a radio or checkbox `<input>`.
44

55
- **Arguments:**
66
- `{Boolean} selected`

Diff for: docs/zh/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,12 @@ Vue Test Utils 是 Vue.js 官方的单元测试实用工具库。
4747
* [isVueInstance](api/wrapper/isVueInstance.md)
4848
* [name](api/wrapper/name.md)
4949
* [props](api/wrapper/props.md)
50+
* [setChecked](api/wrapper/setChecked.md)
5051
* [setData](api/wrapper/setData.md)
5152
* [setMethods](api/wrapper/setMethods.md)
5253
* [setProps](api/wrapper/setProps.md)
54+
* [setSelected](api/wrapper/setSelected.md)
55+
* [setValue](api/wrapper/setValue.md)
5356
* [text](api/wrapper/text.md)
5457
* [trigger](api/wrapper/trigger.md)
5558
* [isVisible](api/wrapper/isVisible.md)

Diff for: docs/zh/api/mount.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ describe('Foo', () => {
6262
})
6363
})
6464
```
65-
**默认的和具名的插槽**
65+
**默认插槽和具名插槽**
6666

6767
```js
6868
import { mount } from '@vue/test-utils'

Diff for: docs/zh/api/options.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ expect(wrapper.find('div')).toBe(true)
6363

6464
- 类型:`{ [name: string]: string }`
6565

66-
提供一个该组件所有带作用域的插槽内容的对象。每个键对应到插槽的名字,每个值可以是一个模板字符串。
66+
提供一个该组件所有作用域插槽内容的对象。每个键对应到插槽的名字,每个值可以是一个模板字符串。
6767

6868
这里有三处限制。
6969

Diff for: docs/zh/api/shallowMount.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ describe('Foo', () => {
7272
})
7373
```
7474

75-
**默认的和具名的插槽**
75+
**默认插槽和具名插槽**
7676

7777
```js
7878
import { shallowMount } from '@vue/test-utils'

Diff for: docs/zh/api/wrapper/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,11 @@ Vue Test Utils 是一个基于包裹器的 API。
4242
!!!include(docs/zh/api/wrapper/isVueInstance.md)!!!
4343
!!!include(docs/zh/api/wrapper/name.md)!!!
4444
!!!include(docs/zh/api/wrapper/props.md)!!!
45+
!!!include(docs/zh/api/wrapper/setChecked.md)!!!
4546
!!!include(docs/zh/api/wrapper/setData.md)!!!
4647
!!!include(docs/zh/api/wrapper/setMethods.md)!!!
4748
!!!include(docs/zh/api/wrapper/setProps.md)!!!
49+
!!!include(docs/zh/api/wrapper/setSelected.md)!!!
50+
!!!include(docs/zh/api/wrapper/setValue.md)!!!
4851
!!!include(docs/zh/api/wrapper/text.md)!!!
4952
!!!include(docs/zh/api/wrapper/trigger.md)!!!

Diff for: docs/zh/api/wrapper/setChecked.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## setChecked(value)
2+
3+
设置一个 `<input>` 单选框或复选框的值。
4+
5+
- **参数:**
6+
- `{Boolean} selected`
7+
8+
- **示例:**
9+
10+
```js
11+
import { mount } from '@vue/test-utils'
12+
import Foo from './Foo.vue'
13+
14+
const wrapper = mount(Foo)
15+
const option = wrapper.find('input[type="radio"]')
16+
option.setChecked()
17+
```

Diff for: docs/zh/api/wrapper/setSelected.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## setSelected(value)
2+
3+
在一个 `<select>` 中选中某个特定的 `<option>`
4+
5+
- **参数:**
6+
- `{Boolean} selected`
7+
8+
- **示例:**
9+
10+
```js
11+
import { mount } from '@vue/test-utils'
12+
import Foo from './Foo.vue'
13+
14+
const wrapper = shallowMount(Foo)
15+
const options = wrapper.find('select').findAll('option')
16+
17+
options.at(1).setSelected()
18+
expect(wrapper.text()).to.contain('option1')
19+
```

Diff for: docs/zh/api/wrapper/setValue.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## setValue(value)
2+
3+
设置一个 `<input>` 文本的值。
4+
5+
- **参数:**
6+
- `{String} value`
7+
8+
- **示例:**
9+
10+
```js
11+
import { mount } from '@vue/test-utils'
12+
import Foo from './Foo.vue'
13+
14+
const wrapper = mount(Foo)
15+
const input = wrapper.find('input[type="text"]')
16+
input.setValue('some value')
17+
```

Diff for: docs/zh/guides/using-with-vuex.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export default{
217217
import { shallowMount, createLocalVue } from '@vue/test-utils'
218218
import Vuex from 'vuex'
219219
import MyComponent from '../../../src/components/MyComponent'
220-
import mymodule from '../../../src/store/mymodule'
220+
import myModule from '../../../src/store/myModule'
221221

222222
const localVue = createLocalVue()
223223

@@ -230,9 +230,7 @@ describe('MyComponent.vue', () => {
230230

231231
beforeEach(() => {
232232
state = {
233-
module: {
234-
clicks: 2
235-
}
233+
clicks: 2
236234
}
237235

238236
actions = {
@@ -241,10 +239,10 @@ describe('MyComponent.vue', () => {
241239

242240
store = new Vuex.Store({
243241
modules: {
244-
mymodule: {
242+
myModule: {
245243
state,
246244
actions,
247-
getters: module.getters
245+
getters: myModule.getters
248246
}
249247
}
250248
})

0 commit comments

Comments
 (0)