File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -54,20 +54,43 @@ Example:
5454
5555``` js
5656import Foo from ' ./Foo.vue'
57+ import MyComponent from ' ./MyComponent.vue'
5758
5859const bazComponent = {
5960 name: ' baz-component' ,
6061 template: ' <p>baz</p>'
6162}
6263
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+
6376const wrapper = shallowMount (Component, {
6477 slots: {
6578 default: [Foo, ' <my-component />' , ' text' ],
6679 fooBar: Foo, // Will match `<slot name="FooBar" />`.
6780 foo: ' <div />' ,
6881 bar: ' bar' ,
6982 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'
7194 }
7295})
7396
You can’t perform that action at this time.
0 commit comments