feat: add mountComponent utils

This commit is contained in:
chenjiahan
2020-08-31 17:49:19 +08:00
parent 77613e3ee5
commit f02afd882c
5 changed files with 34 additions and 32 deletions
+4 -7
View File
@@ -1,14 +1,11 @@
import { createApp, nextTick } from 'vue';
import { nextTick } from 'vue';
import { inBrowser, mountComponent } from '../utils';
import VanDialog from './Dialog';
import { inBrowser } from '../utils';
let instance;
function initInstance() {
const root = document.createElement('div');
document.body.appendChild(root);
instance = createApp({
({ instance } = mountComponent({
data() {
return {
dialogProps: {
@@ -35,7 +32,7 @@ function initInstance() {
/>
);
},
}).mount(root);
}));
}
function Dialog(options) {