Skip to content

[docs][zh] keep update #702

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/api/wrapper/setChecked.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## setChecked(value)

Sets the value of a radio or checkbox `<input`>.
Sets the value of a radio or checkbox `<input>`.

- **Arguments:**
- `{Boolean} selected`
Expand Down
3 changes: 3 additions & 0 deletions docs/zh/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@ Vue Test Utils 是 Vue.js 官方的单元测试实用工具库。
* [isVueInstance](api/wrapper/isVueInstance.md)
* [name](api/wrapper/name.md)
* [props](api/wrapper/props.md)
* [setChecked](api/wrapper/setChecked.md)
* [setData](api/wrapper/setData.md)
* [setMethods](api/wrapper/setMethods.md)
* [setProps](api/wrapper/setProps.md)
* [setSelected](api/wrapper/setSelected.md)
* [setValue](api/wrapper/setValue.md)
* [text](api/wrapper/text.md)
* [trigger](api/wrapper/trigger.md)
* [isVisible](api/wrapper/isVisible.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/api/mount.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('Foo', () => {
})
})
```
**默认的和具名的插槽:**
**默认插槽和具名插槽:**

```js
import { mount } from '@vue/test-utils'
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/api/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ expect(wrapper.find('div')).toBe(true)

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

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

这里有三处限制。

Expand Down
2 changes: 1 addition & 1 deletion docs/zh/api/shallowMount.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('Foo', () => {
})
```

**默认的和具名的插槽:**
**默认插槽和具名插槽:**

```js
import { shallowMount } from '@vue/test-utils'
Expand Down
3 changes: 3 additions & 0 deletions docs/zh/api/wrapper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ Vue Test Utils 是一个基于包裹器的 API。
!!!include(docs/zh/api/wrapper/isVueInstance.md)!!!
!!!include(docs/zh/api/wrapper/name.md)!!!
!!!include(docs/zh/api/wrapper/props.md)!!!
!!!include(docs/zh/api/wrapper/setChecked.md)!!!
!!!include(docs/zh/api/wrapper/setData.md)!!!
!!!include(docs/zh/api/wrapper/setMethods.md)!!!
!!!include(docs/zh/api/wrapper/setProps.md)!!!
!!!include(docs/zh/api/wrapper/setSelected.md)!!!
!!!include(docs/zh/api/wrapper/setValue.md)!!!
!!!include(docs/zh/api/wrapper/text.md)!!!
!!!include(docs/zh/api/wrapper/trigger.md)!!!
17 changes: 17 additions & 0 deletions docs/zh/api/wrapper/setChecked.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## setChecked(value)

设置一个 `<input>` 单选框或复选框的值。

- **参数:**
- `{Boolean} selected`

- **示例:**

```js
import { mount } from '@vue/test-utils'
import Foo from './Foo.vue'

const wrapper = mount(Foo)
const option = wrapper.find('input[type="radio"]')
option.setChecked()
```
19 changes: 19 additions & 0 deletions docs/zh/api/wrapper/setSelected.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## setSelected(value)

在一个 `<select>` 中选中某个特定的 `<option>`。

- **参数:**
- `{Boolean} selected`

- **示例:**

```js
import { mount } from '@vue/test-utils'
import Foo from './Foo.vue'

const wrapper = shallowMount(Foo)
const options = wrapper.find('select').findAll('option')

options.at(1).setSelected()
expect(wrapper.text()).to.contain('option1')
```
17 changes: 17 additions & 0 deletions docs/zh/api/wrapper/setValue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## setValue(value)

设置一个 `<input>` 文本的值。

- **参数:**
- `{String} value`

- **示例:**

```js
import { mount } from '@vue/test-utils'
import Foo from './Foo.vue'

const wrapper = mount(Foo)
const input = wrapper.find('input[type="text"]')
input.setValue('some value')
```
10 changes: 4 additions & 6 deletions docs/zh/guides/using-with-vuex.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export default{
import { shallowMount, createLocalVue } from '@vue/test-utils'
import Vuex from 'vuex'
import MyComponent from '../../../src/components/MyComponent'
import mymodule from '../../../src/store/mymodule'
import myModule from '../../../src/store/myModule'

const localVue = createLocalVue()

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

beforeEach(() => {
state = {
module: {
clicks: 2
}
clicks: 2
}

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

store = new Vuex.Store({
modules: {
mymodule: {
myModule: {
state,
actions,
getters: module.getters
getters: myModule.getters
}
}
})
Expand Down