Skip to content

Commit 99c0f7a

Browse files
committed
Add document
1 parent 76f14f6 commit 99c0f7a

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/en/api/options.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,29 @@ const wrapper = shallow(Component, {
6161
expect(wrapper.find('div')).toBe(true)
6262
```
6363

64+
#### Passing text
65+
66+
You can pass text to `slots`.
67+
There is a limitation to this.
68+
69+
The text works below.
70+
71+
```js
72+
const wrapper1 = mount(ComponentWithSlots, { slots: { default: '1{{ foo }}2' }})
73+
const wrapper2 = mount(ComponentWithSlots, { slots: { default: '<p>1</p>{{ foo }}<p>2</p>' }})
74+
const wrapper3 = mount(ComponentWithSlots, { slots: { default: '<p>1</p>{{ foo }}' }})
75+
const wrapper4 = mount(ComponentWithSlots, { slots: { default: '123' }})
76+
const wrapper5 = mount(ComponentWithSlots, { slots: { default: '1<p>2</p>{{ foo }}3' }})
77+
```
78+
79+
This does not work for the text below.
80+
When there are some elements, `{{ }}` is required.
81+
82+
```js
83+
const wrapper1 = mount(ComponentWithSlots, { slots: { default: '<p>1</p><p>2</p>' }})
84+
const wrapper2 = mount(ComponentWithSlots, { slots: { default: '1<p>2</p>3' }})
85+
```
86+
6487
### `stubs`
6588

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

0 commit comments

Comments
 (0)