UNPKG

@tencentcloud/roomkit-electron-vue3

Version:

<h1 align="center"> TUIRoomKit</h1> Conference (TUIRoomKit) is a product suitable for multi-person audio and video conversation scenarios such as business meetings, webinars, and online education. By integrating this product, you can add room management,

53 lines (52 loc) 1.15 kB
import { createVNode, render } from "vue"; import TUINotification from "./index.vue.mjs"; let notificationInstance = null; let container = null; let timer = null; const Notification = ({ message, confirm, cancel, confirmButtonText, cancelButtonText }) => { const fullscreenElement = document.fullscreenElement || document.getElementById("roomContainer") || document.body; if (!notificationInstance) { container = document.createElement("div"); fullscreenElement.appendChild(container); } const close = () => { if (container) { render(null, container); fullscreenElement.removeChild(container); notificationInstance = null; container = null; } if (timer) { clearTimeout(timer); timer = null; } }; const vnode = createVNode(TUINotification, { message, confirm, cancel, confirmButtonText, cancelButtonText, close }); if (container) { render(vnode, container); notificationInstance = vnode; } if (timer) { clearTimeout(timer); } timer = setTimeout(close, 3e3); return { close }; }; export { Notification as default };