import { createApp } from 'vue'
import index from './index.vue'

export default (options) => {
    // 创建一个节点，并将组件挂载上去
    const root = document.createElement('div')
    document.body.appendChild(root)

    const app = createApp(index, {
        ...options, visible: true, remove() {
            app.unmount(root) //创建完后要进行销毁
            document.body.removeChild(root)
        }
    })
    return app.mount(root)
}