File tree 1 file changed +24
-1
lines changed
1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -54,20 +54,43 @@ Example:
54
54
55
55
``` js
56
56
import Foo from ' ./Foo.vue'
57
+ import MyComponent from ' ./MyComponent.vue'
57
58
58
59
const bazComponent = {
59
60
name: ' baz-component' ,
60
61
template: ' <p>baz</p>'
61
62
}
62
63
64
+ const yourComponent = {
65
+ props: {
66
+ foo: {
67
+ type: String ,
68
+ required: true
69
+ }
70
+ },
71
+ render (h ) {
72
+ return h (' p' , this .foo )
73
+ }
74
+ }
75
+
63
76
const wrapper = shallowMount (Component, {
64
77
slots: {
65
78
default: [Foo, ' <my-component />' , ' text' ],
66
79
fooBar: Foo, // Will match `<slot name="FooBar" />`.
67
80
foo: ' <div />' ,
68
81
bar: ' bar' ,
69
82
baz: bazComponent,
70
- qux: ' <my-component />'
83
+ qux: ' <my-component />' ,
84
+ quux: ' <your-component foo="lorem"/><your-component :foo="yourProperty"/>'
85
+ },
86
+ stubs: {
87
+ // used to register custom components
88
+ ' my-component' : MyComponent,
89
+ ' your-component' : yourComponent
90
+ },
91
+ mocks: {
92
+ // used to add properties to the rendering context
93
+ yourProperty: ' ipsum'
71
94
}
72
95
})
73
96
You can’t perform that action at this time.
0 commit comments