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

View File

@@ -1,6 +1,6 @@
import { createApp, nextTick } from 'vue';
import { nextTick } from 'vue';
import { isObject, inBrowser, mountComponent } from '../utils';
import VanNotify from './Notify';
import { isObject, inBrowser } from '../utils';
let timer;
let instance;
@@ -10,10 +10,7 @@ function parseOptions(message) {
}
function initInstance() {
const root = document.createElement('div');
document.body.appendChild(root);
instance = createApp({
({ instance } = mountComponent({
data() {
return {
notifyProps: {
@@ -39,7 +36,7 @@ function initInstance() {
/>
);
},
}).mount(root);
}));
}
function Notify(options) {