-
Notifications
You must be signed in to change notification settings - Fork 667
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
docs: update docs/ja #533
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# `mount(component {, options}])` | ||
# `mount(component [, options])` | ||
|
||
- **Arguments:** | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# `shallow(component {, options}])` | ||
# `shallow(component [, options])` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @eddyerburgh |
||
|
||
- **Arguments:** | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# mount(component {, options}]) | ||
# mount(component [, options]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 原文が間違っているのでこのpull requestで修正しています。 |
||
|
||
- **引数:** | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
|
||
- [`context`](#context) | ||
- [`slots`](#slots) | ||
- [`scopedSlots`](#scopedslots) | ||
- [`stubs`](#stubs) | ||
- [`mocks`](#mocks) | ||
- [`localVue`](#localvue) | ||
|
@@ -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` が配列の場合、すべてのスタブは `<!---->` になります。 | ||
|
||
例: | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# shallow(component {, options}]) | ||
# shallow(component [, options]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 原文が間違っているのでこのpull requestで修正しています。 |
||
|
||
- **引数:** | ||
|
||
|
There was a problem hiding this comment.
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.