Skip to content

Update Russian docs #854

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 51 commits into from
Jul 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
8210198
Migrate Russian docs to VuePress
lex111 Jun 11, 2018
ecebea9
Russian docs: video link for common tips
lex111 Jun 11, 2018
88f2232
Russian docs: overwrite arrays in setData
lex111 Jun 11, 2018
41142a2
Russian docs: remove phantomjs limitation
lex111 Jun 11, 2018
357aed6
Russian translation: actualize docs
lex111 Jun 11, 2018
87bd777
Merge remote-tracking branch 'origin' into vuepress-ru
lex111 Jun 16, 2018
e73a1f3
Russian translation: silence warnings when updating prop
lex111 Jun 16, 2018
5c8acab
Russian translation: add max-len rule
lex111 Jun 16, 2018
2393f2d
Fix build
lex111 Jun 17, 2018
6b49f1f
Fix build
lex111 Jun 17, 2018
fab22dd
Fix menu items
lex111 Jun 17, 2018
4b6aa47
Russian translation: fix headings
lex111 Jun 17, 2018
4223d08
Russian translation: fix all issues
lex111 Jun 17, 2018
3a83e0c
Russian translation: more fixes
lex111 Jun 17, 2018
c6f0f06
Russian translation: fix headings of guides
lex111 Jun 17, 2018
bce0f19
Russian translation: fixes for wrapper-array
lex111 Jun 17, 2018
7559dff
Russian translation: replace shallow with shallowMount
lex111 Jun 19, 2018
7591e24
Russian translation: minor fixes
lex111 Jun 19, 2018
b0b27bf
Russian translation: fixes
lex111 Jun 19, 2018
500867b
Russian translation: fixes
lex111 Jun 19, 2018
6bb0c61
Russian translation: fixes
lex111 Jun 19, 2018
0a52a7c
Merge branch 'dev' of https://github.com/vuejs/vue-test-utils into vu…
lex111 Jun 20, 2018
00a8f94
Russian translation: tweaks
lex111 Jun 20, 2018
7f5b7c8
Russian translation: silentWarnings to silent
lex111 Jun 20, 2018
06fe6d8
Russian translation: improve document for setChecked(), setSelected()…
lex111 Jun 20, 2018
b00ef25
Russian translation: complete update in accordance with the original …
lex111 Jun 20, 2018
658e7f7
Russian translation: fix lint error
lex111 Jun 20, 2018
8344ff5
Russian translation: replace from mapCoverage to collectCoverage
lex111 Jun 20, 2018
cd6247d
Russian translation: fix anchor
lex111 Jun 21, 2018
065f3a4
Merge remote-tracking branch 'origin' into vuepress-ru
lex111 Jun 29, 2018
9b9da48
Russian translation: docs: update attributes.md
lex111 Jun 29, 2018
935f71c
Russian translation: feat: element, vnode, vm, and options are read-only
lex111 Jun 29, 2018
c20a7cd
Russian translation: feat: throw error if the read-only property is t…
lex111 Jun 29, 2018
1caef3f
Russian translation: Update README.md
lex111 Jun 29, 2018
d79cee4
Russian translation: fixes after review of @Alex-Sokolov
lex111 Jun 29, 2018
ce0e2f4
setChecked.md small fix
Alex-Sokolov Jun 30, 2018
6ae9950
using-with-vuex.md fix header
Alex-Sokolov Jun 30, 2018
647aad8
Russian translation: improve types
lex111 Jul 1, 2018
c75ec3a
Merge pull request #1 from translation-gang/lex111-patch-1
Alex-Sokolov Jul 1, 2018
d9d2b99
Merge branch 'dev' of https://github.com/vuejs/vue-test-utils into vu…
lex111 Jul 25, 2018
6379b81
docs(ru): add setChecked and setValue
lex111 Jul 25, 2018
163ad98
docs(ru): use setValue() on select element
lex111 Jul 25, 2018
ed67815
docs(ru): recursively call Vue.set in setData
lex111 Jul 25, 2018
19ea7f0
docs(ru): add parentComponent option
lex111 Jul 25, 2018
b818ec4
docs(ru): update slots section in options.md
lex111 Jul 25, 2018
0cdf567
Merge branch 'dev' of github.com:translation-gang/vue-test-utils into…
lex111 Jul 25, 2018
93950f7
docs(ru:wrapper-array.setValue): translate missing text
lex111 Jul 29, 2018
32fcc5e
docs(ru): add a link for parentComponent to README.md
lex111 Jul 29, 2018
a2af6be
docs(ru): remove unnecessary files
lex111 Jul 29, 2018
1da2606
Update setChecked.md
lex111 Jul 29, 2018
bde4a1e
Update options.md
lex111 Jul 29, 2018
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
5 changes: 4 additions & 1 deletion docs/ru/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Vue Test Utils — официальная библиотека модульно
* [mount](api/mount.md)
* [shallowMount](api/shallowMount.md)
* [render](api/render.md)
* [renderToString](api/renderToString.md)
* [renderToString](api/renderToString.md)
* [Опции монтирования](api/options.md)
- [context](api/options.md#context)
- [slots](api/options.md#slots)
Expand All @@ -28,6 +28,7 @@ Vue Test Utils — официальная библиотека модульно
- [attachToDocument](api/options.md#attachtodocument)
- [attrs](api/options.md#attrs)
- [listeners](api/options.md#listeners)
- [parentComponent](api/options.md#parentComponent)
- [provide](api/options.md#provide)
- [sync](api/options.md#sync)
- [другие опции](api/options.md#other-options)
Expand Down Expand Up @@ -65,9 +66,11 @@ Vue Test Utils — официальная библиотека модульно
* [is](api/wrapper-array/is.md)
* [isEmpty](api/wrapper-array/isEmpty.md)
* [isVueInstance](api/wrapper-array/isVueInstance.md)
* [setChecked](api/wrapper-array/setChecked.md)
* [setData](api/wrapper-array/setData.md)
* [setMethods](api/wrapper-array/setMethods.md)
* [setProps](api/wrapper-array/setProps.md)
* [setValue](api/wrapper-array/setValue.md)
* [trigger](api/wrapper-array/trigger.md)
* [isVisible](api/wrapper-array/isVisible.md)
* [Компоненты](api/components/)
Expand Down
31 changes: 28 additions & 3 deletions docs/ru/api/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- [`attachToDocument`](#attachtodocument)
- [`attrs`](#attrs)
- [`listeners`](#listeners)
- [`parentComponent`](#parentComponent)
- [`provide`](#provide)
- [`sync`](#sync)

Expand Down Expand Up @@ -46,16 +47,23 @@ expect(wrapper.is(Component)).toBe(true)

```js
import Foo from './Foo.vue'
import Bar from './Bar.vue'

const bazComponent = {
name: 'baz-component',
template: '<p>baz</p>'
}

const wrapper = shallowMount(Component, {
slots: {
default: [Foo, Bar],
default: [Foo, '<my-component />', 'text'],
fooBar: Foo, // будет соответствовать `<slot name="FooBar" />`
foo: '<div />',
bar: 'bar'
bar: 'bar',
baz: bazComponent,
qux: '<my-component />'
}
})

expect(wrapper.find('div')).toBe(true)
```

Expand Down Expand Up @@ -183,6 +191,23 @@ expect(wrapper.vm.$route).toBeInstanceOf(Object)

Устанавливает объект `$listeners` на экземпляре компонента.

## parentComponent

- Тип: `Object`

Компонент для использования в качестве родительского для смонтированного компонента.

Пример:

```js
import Foo from './Foo.vue'

const wrapper = shallowMount(Component, {
parentComponent: Foo
})
expect(wrapper.vm.$parent.name).toBe('foo')
```

## provide

- Тип: `Object`
Expand Down
2 changes: 2 additions & 0 deletions docs/ru/api/wrapper-array/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
!!!include(docs/ru/api/wrapper-array/is.md)!!!
!!!include(docs/ru/api/wrapper-array/isEmpty.md)!!!
!!!include(docs/ru/api/wrapper-array/isVueInstance.md)!!!
!!!include(docs/api/wrapper-array/setChecked.md)!!!
!!!include(docs/ru/api/wrapper-array/setData.md)!!!
!!!include(docs/ru/api/wrapper-array/setMethods.md)!!!
!!!include(docs/ru/api/wrapper-array/setProps.md)!!!
!!!include(docs/api/wrapper-array/setValue.md)!!!
!!!include(docs/ru/api/wrapper-array/trigger.md)!!!
38 changes: 38 additions & 0 deletions docs/ru/api/wrapper-array/setChecked.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## setChecked(checked)

Этот метод — псевдоним следующего кода.

```js
wrapperArray.wrappers.forEach(wrapper => wrapper.setChecked(checked))
```

- **Принимает:**
- `{Boolean} checked (по умолчанию: true)`

- **Пример:**

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

const wrapper = mount({
data () {
return {
t1: false,
t2: ''
}
},
template: `
<div>
<input type="checkbox" name="t1" class="foo" v-model="t1" />
<input type="radio" name="t2" class="foo" value="foo" v-model="t2"/>
<input type="radio" name="t2" class="bar" value="bar" v-model="t2"/>
</div>`
})

const wrapperArray = wrapper.findAll('.foo')
expect(wrapper.vm.t1).to.equal(false)
expect(wrapper.vm.t2).to.equal('')
wrapperArray.setChecked()
expect(wrapper.vm.t1).to.equal(true)
expect(wrapper.vm.t2).to.equal('foo')
```
37 changes: 37 additions & 0 deletions docs/ru/api/wrapper-array/setValue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## setValue(value)

Этот метод — псевдоним следующего кода.

```js
wrapperArray.wrappers.forEach(wrapper => wrapper.setValue(value))
```

- **Принимает:**
- `{any} value`

- **Пример:**

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

const wrapper = mount({
data () {
return {
t1: '',
t2: ''
}
},
template: `
<div>
<input type="text" name="t1" class="foo" v-model="t1" />
<input type="text" name="t2" class="foo" v-model="t2"/>
</div>`
})

const wrapperArray = wrapper.findAll('.foo')
expect(wrapper.vm.t1).to.equal('')
expect(wrapper.vm.t2).to.equal('')
wrapperArray.setValue('foo')
expect(wrapper.vm.t1).to.equal('foo')
expect(wrapper.vm.t2).to.equal('foo')
```
2 changes: 2 additions & 0 deletions docs/ru/api/wrapper/setData.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Устанавливает данные `Wrapper` `vm`.

setData работает путём рекурсивного вызова Vue.set.

**Обратите внимание, что `Wrapper` должен содержать экземпляр Vue.**

setData работает путём слияния существующих свойств, за исключением массивов, которые перезаписываются.
Expand Down
25 changes: 18 additions & 7 deletions docs/ru/api/wrapper/setValue.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## setValue(value)

Устанавливает значение ввода текстового элемента и обновляет связанные данные `v-model`.
Устанавливает значение элемента поле ввода текста или выпадающего списка и обновляет связанные данные `v-model`.

- **Аргументы:**
- `{String} value`
- `{any} value`

- **Пример:**

Expand All @@ -12,15 +12,26 @@ 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')

const select = wrapper.find('select')
select.setValue('option value')
```

- **Примечание:**

`textInput.setValue(value)` — псевдоним следующего кода.
- `textInput.setValue(value)` — псевдоним следующего кода.

```js
textInput.element.value = value
textInput.trigger('input')
```
```js
textInput.element.value = value
textInput.trigger('input')
```

- `select.setValue(value)` — псевдоним следующего кода.

```js
select.element.value = value
select.trigger('change')
```