mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 10:44:59 +00:00
feat: add mountComponent utils
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user