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,

69 lines (68 loc) 1.72 kB
import { createVNode, render } from "vue"; import TUINotification from "./index.vue.mjs"; function NotificationFactory() { let notificationInstance = null; let container = null; let timer = null; let fullscreenElement = null; function openInviteNotification(options) { if (document.getElementById(options.appendTo)) { fullscreenElement = document.getElementById( options.appendTo ); } else { fullscreenElement = document.fullscreenElement || document.body; } if (!notificationInstance) { container = document.createElement("div"); container.className = "tui-room-notification"; fullscreenElement == null ? void 0 : fullscreenElement.appendChild(container); } const { appendTo, customClass, message, onConfirm, onCancel, confirmButtonText, cancelButtonText } = options; const vnode = createVNode(TUINotification, { appendTo, customClass, message, onConfirm, onCancel, confirmButtonText, cancelButtonText, close }); if (container) { render(vnode, container); notificationInstance = vnode; } if (timer) { clearTimeout(timer); } timer = setTimeout(close, options.duration || 3e4); } function close() { if (container) { render(null, container); fullscreenElement == null ? void 0 : fullscreenElement.removeChild(container); notificationInstance = null; container = null; } if (timer) { clearTimeout(timer); timer = null; } } return { openInviteNotification }; } const inviteNotification = NotificationFactory(); export { inviteNotification };