Skip to content

docs: update docs/ja #533

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
Apr 26, 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/en/api/mount.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `mount(component {, options}])`
# `mount(component [, options])`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eddyerburgh
I fixed this format.


- **Arguments:**

Expand Down
2 changes: 1 addition & 1 deletion docs/en/api/shallow.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `shallow(component {, options}])`
# `shallow(component [, options])`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eddyerburgh
I fixed this format.


- **Arguments:**

Expand Down
5 changes: 3 additions & 2 deletions docs/ja/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* [マウンティングオプション](api/options.md)
- [context](api/options.md#context)
- [slots](api/options.md#slots)
- [scopedSlots](api/options.md#scopedslots)
- [stubs](api/options.md#stubs)
- [mocks](api/options.md#mocks)
- [localVue](api/options.md#localvue)
Expand Down Expand Up @@ -51,7 +52,7 @@
* [setProps](api/wrapper/setProps.md)
* [text](api/wrapper/text.md)
* [trigger](api/wrapper/trigger.md)
* [visible](api/wrapper/visible.md)
* [isVisible](api/wrapper/isVisible.md)
* [WrapperArray](api/wrapper-array/README.md)
* [at](api/wrapper-array/at.md)
* [contains](api/wrapper-array/contains.md)
Expand All @@ -65,7 +66,7 @@
* [setMethods](api/wrapper-array/setMethods.md)
* [setProps](api/wrapper-array/setProps.md)
* [trigger](api/wrapper-array/trigger.md)
* [visible](api/wrapper-array/visible.md)
* [isVisible](api/wrapper-array/isVisible.md)
* [コンポーネント](api/components/README.md)
* [TransitionStub](api/components/TransitionStub.md)
* [TransitionGroupStub](api/components/TransitionGroupStub.md)
Expand Down
1 change: 1 addition & 0 deletions docs/ja/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* [マウンティングオプション](api/options.md)
- [context](api/options.md#context)
- [slots](api/options.md#slots)
- [scopedSlots](api/options.md#scopedslots)
- [stubs](api/options.md#stubs)
- [mocks](api/options.md#mocks)
- [localVue](api/options.md#localvue)
Expand Down
5 changes: 3 additions & 2 deletions docs/ja/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* [マウンティングオプション](./options.md)
- [context](./options.md#context)
- [slots](./options.md#slots)
- [scopedSlots](./options.md#scopedslots)
- [stubs](./options.md#stubs)
- [mocks](./options.md#mocks)
- [localVue](./options.md#localvue)
Expand Down Expand Up @@ -37,7 +38,7 @@
* [setProps](./wrapper/setProps.md)
* [text](./wrapper/text.md)
* [trigger](./wrapper/trigger.md)
* [visible](./wrapper/visible.md)
* [isVisible](./wrapper/isVisible.md)
* [WrapperArray](./wrapper-array/README.md)
* [at](./wrapper-array/at.md)
* [contains](./wrapper-array/contains.md)
Expand All @@ -51,7 +52,7 @@
* [setMethods](./wrapper-array/setMethods.md)
* [setProps](./wrapper-array/setProps.md)
* [trigger](./wrapper-array/trigger.md)
* [visible](./wrapper-array/visible.md)
* [isVisible](./wrapper-array/isVisible.md)
* [コンポーネント](./components/README.md)
* [TransitionStub](./components/TransitionStub.md)
* [TransitionGroupStub](./components/TransitionGroupStub.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/ja/api/mount.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# mount(component {, options}])
# mount(component [, options])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原文が間違っているのでこのpull requestで修正しています。


- **引数:**

Expand Down
31 changes: 29 additions & 2 deletions docs/ja/api/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- [`context`](#context)
- [`slots`](#slots)
- [`scopedSlots`](#scopedslots)
- [`stubs`](#stubs)
- [`mocks`](#mocks)
- [`localVue`](#localvue)
Expand Down Expand Up @@ -59,13 +60,39 @@ expect(wrapper.find('div')).toBe(true)

テキストを値として `slots` に渡すことはできますが、1つ制限事項があります。
PhantomJS をサポートしません。
[Puppeteer](https://github.com/karma-runner/karma-chrome-launcher#headless-chromium-with-puppeteer)を使用してください。
代わりに [Puppeteer](https://github.com/karma-runner/karma-chrome-launcher#headless-chromium-with-puppeteer) を使用してください。

### `scopedSlots`

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

コンポーネントにスコープ付きスロットのコンテンツのオブジェクトを渡します。key はスロット名に対応します。値はテンプレート文字列を指定します。

3つ制限事項があります。

* [email protected]+ のみをサポートします。

* `<template>` タグを `scopedSlots` オプションのルート要素として使用することはできません。

* PhantomJS をサポートしません。
代わりに [Puppeteer](https://github.com/karma-runner/karma-chrome-launcher#headless-chromium-with-puppeteer) を使用してください。

例:

```js
const wrapper = shallow(Component, {
scopedSlots: {
foo: '<p slot-scope="props">{{props.index}},{{props.text}}</p>'
}
})
expect(wrapper.find('#fooWrapper').html()).toBe('<div id="fooWrapper"><p>0,text1</p><p>1,text2</p><p>2,text3</p></div>')
```

### `stubs`

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

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

例:

Expand Down
2 changes: 1 addition & 1 deletion docs/ja/api/shallow.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shallow(component {, options}])
# shallow(component [, options])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原文が間違っているのでこのpull requestで修正しています。


- **引数:**

Expand Down
5 changes: 3 additions & 2 deletions docs/ja/api/wrapper-array/trigger.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# trigger(eventName)
# trigger(eventName [, options])

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

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

- **引数:**
- `{string} eventName
 - `{string} eventName` **必須**
 - `{Object} options` **オプション**

- **例:**

Expand Down
8 changes: 8 additions & 0 deletions docs/ja/api/wrapper/find.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,18 @@ import Foo from './Foo.vue'
import Bar from './Bar.vue'

const wrapper = mount(Foo)

const div = wrapper.find('div')
expect(div.is('div')).toBe(true)

const bar = wrapper.find(Bar)
expect(bar.is(Bar)).toBe(true)

const barByName = wrapper.find({ name: 'bar' })
expect(barByName.is(Bar)).toBe(true)

const fooRef = wrapper.find({ ref: 'foo' })
expect(fooRef.is(Foo)).toBe(true)
```

- **参照:** [Wrapper](./README.md)
6 changes: 3 additions & 3 deletions docs/ja/api/wrapper/trigger.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# trigger(eventName)
# trigger(eventType [, options ])

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

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

- **引数:**
- `{string} eventName`
- `{Object} options`
- `{string} eventName` **必須**
- `{Object} options` **オプション**

- **例:**

Expand Down
10 changes: 4 additions & 6 deletions docs/ja/guides/testing-SFCs-with-jest.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,12 @@ npm install --save-dev vue-jest
"transform": {
// vue-jest で *.vue ファイルを処理する
".*\\.(vue)$": "<rootDir>/node_modules/vue-jest"
},
"mapCoverage": true
}
}
}
```

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

## Webpack エイリアスの処理

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

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

`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` にします。
`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) に配列で定義します。

```json
{
Expand All @@ -168,8 +167,7 @@ Jest は複数のフォーマットでカバレッジを取ることができま
"collectCoverageFrom": [
"**/*.{js,vue}",
"!**/node_modules/**"
],
"mapCoverage": true
]
}
}
```
Expand Down
4 changes: 2 additions & 2 deletions docs/ja/guides/using-with-vuex.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ describe('Modules.vue', () => {

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

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

```js
// mutations.js
Expand Down Expand Up @@ -322,7 +322,7 @@ test('evenOrOdd returns even if state.count is even', () => {
expect(getters.evenOrOdd(state)).toBe('even')
})

test('evenOrOdd returns odd if state.count is even', () => {
test('evenOrOdd returns odd if state.count is odd', () => {
const state = {
count: 1
}
Expand Down