forked from drone/command-center-dashboard

zhongrj
2025-03-29 cdd351a2385eeaa1a024c279fb4f6a92e75b9d37
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import MessageConstructor from './index.vue';
import { createVNode, render } from 'vue';
 
export default (function () {
  return (opts = {}) => {
    let options = {
      app: opts,
    };
    const parent = document.createElement('div');
    let instance = createVNode(MessageConstructor, options);
    instance.props.onDestroy = () => {
      render(null, parent);
    };
    render(instance, parent);
    document.body.appendChild(parent.firstElementChild);
    return instance;
  };
})();