diff --git a/docs/api/options.md b/docs/api/options.md index b593f0bc3..ecf1cda5f 100644 --- a/docs/api/options.md +++ b/docs/api/options.md @@ -54,12 +54,25 @@ Example: ```js import Foo from './Foo.vue' +import MyComponent from './MyComponent.vue' const bazComponent = { name: 'baz-component', template: '

baz

' } +const yourComponent = { + props: { + foo: { + type: String, + required: true + } + }, + render(h) { + return h('p', this.foo) + } +} + const wrapper = shallowMount(Component, { slots: { default: [Foo, '', 'text'], @@ -67,7 +80,17 @@ const wrapper = shallowMount(Component, { foo: '
', bar: 'bar', baz: bazComponent, - qux: '' + qux: '', + quux: '' + }, + stubs: { + // used to register custom components + 'my-component': MyComponent, + 'your-component': yourComponent + }, + mocks: { + // used to add properties to the rendering context + yourProperty: 'ipsum' } })