@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.26 kB
JavaScript
;
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const Vue = require("vue");
const index = require("./index.vue.js");
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) {
Vue.render(null, container);
fullscreenElement.removeChild(container);
notificationInstance = null;
container = null;
}
if (timer) {
clearTimeout(timer);
timer = null;
}
};
const vnode = Vue.createVNode(index.default, {
message,
confirm,
cancel,
confirmButtonText,
cancelButtonText,
close
});
if (container) {
Vue.render(vnode, container);
notificationInstance = vnode;
}
if (timer) {
clearTimeout(timer);
}
timer = setTimeout(close, 3e3);
return {
close
};
};
exports.default = Notification;