File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,29 @@ const wrapper = shallow(Component, {
61
61
expect (wrapper .find (' div' )).toBe (true )
62
62
```
63
63
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
+
64
87
### ` stubs `
65
88
66
89
- type: ` { [name: string]: Component | boolean } | Array<string> `
You can’t perform that action at this time.
0 commit comments