Commit 97572d42 authored by Paul Slaughter's avatar Paul Slaughter

Create 'mountComponentWithRender' for testing with slots

parent d2590b15
import Vue from 'vue';
const mountComponent = (Component, props = {}, el = null) => const mountComponent = (Component, props = {}, el = null) =>
new Component({ new Component({
propsData: props, propsData: props,
...@@ -25,4 +27,12 @@ export const mountComponentWithSlots = (Component, { props, slots }) => { ...@@ -25,4 +27,12 @@ export const mountComponentWithSlots = (Component, { props, slots }) => {
return component.$mount(); return component.$mount();
}; };
/**
* Mount a component with the given render method.
*
* This helps with inserting slots that need to be compiled.
*/
export const mountComponentWithRender = (render, el = null) =>
mountComponent(Vue.extend({ render }), {}, el);
export default mountComponent; export default mountComponent;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment