2018-08-21 09:18:27 -04:00
|
|
|
import Vue from 'vue';
|
|
|
|
|
2018-05-28 05:48:22 -04:00
|
|
|
const mountComponent = (Component, props = {}, el = null) =>
|
|
|
|
new Component({
|
|
|
|
propsData: props,
|
|
|
|
}).$mount(el);
|
2017-10-27 13:16:28 -04:00
|
|
|
|
2018-05-28 05:48:22 -04:00
|
|
|
export const createComponentWithStore = (Component, store, propsData = {}) =>
|
|
|
|
new Component({
|
|
|
|
store,
|
|
|
|
propsData,
|
2018-05-11 05:42:05 -04:00
|
|
|
});
|
|
|
|
|
2018-04-08 06:20:05 -04:00
|
|
|
export const mountComponentWithStore = (Component, { el, props, store }) =>
|
|
|
|
new Component({
|
|
|
|
store,
|
2018-05-28 05:48:22 -04:00
|
|
|
propsData: props || {},
|
2018-04-08 06:20:05 -04:00
|
|
|
}).$mount(el);
|
|
|
|
|
2018-07-26 12:24:48 -04:00
|
|
|
export const mountComponentWithSlots = (Component, { props, slots }) => {
|
|
|
|
const component = new Component({
|
|
|
|
propsData: props || {},
|
|
|
|
});
|
|
|
|
|
|
|
|
component.$slots = slots;
|
|
|
|
|
|
|
|
return component.$mount();
|
|
|
|
};
|
|
|
|
|
2018-08-21 09:18:27 -04:00
|
|
|
/**
|
|
|
|
* 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);
|
|
|
|
|
2018-05-11 05:42:05 -04:00
|
|
|
export default mountComponent;
|