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,

90 lines (89 loc) 2.53 kB
"use strict"; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); const Vue = require("vue"); const SvgIcon = require("../SvgIcon.vue.js"); const success = require("./images/success.vue.js"); const error = require("./images/error.vue.js"); const warning = require("./images/warning.vue.js"); const info = require("./images/info.vue.js"); const _hoisted_1 = { class: "t-message-text" }; const _sfc_main = /* @__PURE__ */ Vue.defineComponent({ __name: "Message", props: { type: { type: String, default: "success" }, message: { type: [String, Number], default: "" }, duration: { type: Number, default: 3e3 }, remove: { type: Function, default: () => { } }, top: { type: Object, default: () => { } }, zIndex: { type: Number, default: 1e3 } }, setup(__props) { const props = __props; const svgName = Vue.computed(() => { const svgMap = { success: success.default, error: error.default, warning: warning.default, info: info.default }; return svgMap[props.type] || info.default; }); const messageRef = Vue.ref(); const isShow = Vue.ref(false); Vue.onMounted(async () => { onOpen(); }); const timer = Vue.ref(); const onOpen = () => { isShow.value = true; timer.value && clearTimeout(timer.value); timer.value = setTimeout(() => { onClose(); }, props.duration); }; const onClose = () => { isShow.value = false; props.remove(); }; return (_ctx, _cache) => { return Vue.openBlock(), Vue.createBlock(Vue.Transition, { name: "message" }, { default: Vue.withCtx(() => [ Vue.withDirectives(Vue.createElementVNode("div", { ref_key: "messageRef", ref: messageRef, class: Vue.normalizeClass(["t-message", `t-message-${props.type}`]), style: Vue.normalizeStyle({ top: props.top.value, zIndex: props.zIndex }) }, [ Vue.createVNode(SvgIcon.default, { icon: svgName.value, class: "t-message-icon" }, null, 8, ["icon"]), Vue.createElementVNode("span", _hoisted_1, Vue.toDisplayString(props.message), 1) ], 6), [ [Vue.vShow, isShow.value] ]) ]), _: 1 }); }; } }); exports.default = _sfc_main;