@meve/ui
Version:
Argon design system components library
23 lines (22 loc) • 557 B
JavaScript
import Vue from 'vue';
export function mountComponent(component, container, options) {
if (options === void 0) {
options = {};
}
var instance = new (Vue.extend(component))(options);
var el = instance.$mount().$el;
var wrapper = document.querySelector(container);
wrapper.appendChild(el);
return {
instance: instance,
unmount: function unmount() {
instance.$destroy();
wrapper.removeChild(el);
}
};
}
export function nextTick() {
return new Promise(function (resolve) {
return Vue.nextTick(resolve);
});
}