UNPKG

@tencentcloud/roomkit-web-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,

43 lines (42 loc) 1.42 kB
import { defineComponent, computed, createElementBlock, openBlock, normalizeClass, renderSlot, createCommentVNode, toDisplayString } from "vue"; const _hoisted_1 = { key: 0, class: "tui-badge-count" }; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "Badge", props: { type: { default: "primary" }, value: { default: "" }, max: { default: 99 }, hidden: { type: Boolean, default: false }, isDot: { type: Boolean, default: false } }, setup(__props) { const props = __props; const showBadge = computed(() => !props.hidden && (props.value || props.isDot)); const content = computed(() => { if (props.isDot) return ""; if (typeof props.value === "number" && typeof props.max === "number") { return props.value > props.max ? `${props.max}+` : props.value; } return props.value; }); const badgeClass = computed(() => [ "tui-badge", `tui-badge-${props.type}`, props.isDot ? "tui-badge-isDot" : "" ]); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass(badgeClass.value) }, [ renderSlot(_ctx.$slots, "default", {}, void 0, true), showBadge.value ? (openBlock(), createElementBlock("sup", _hoisted_1, toDisplayString(content.value), 1)) : createCommentVNode("", true) ], 2); }; } }); export { _sfc_main as default };