@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,
83 lines (82 loc) • 3.48 kB
JavaScript
import { defineComponent, computed, createElementBlock, openBlock, withDirectives, createCommentVNode, unref, normalizeClass, renderSlot, createBlock, createElementVNode, toDisplayString, createTextVNode, createVNode } from "vue";
import { TUIIcon, IconUnSupport, IconArrowUp } from "@tencentcloud/uikit-base-component-vue3";
import { IconButtonLayout } from "../../../constants/room.mjs";
import { isMobile } from "../../../utils/environment.mjs";
import vTap from "../../../directives/vTap.mjs";
const _hoisted_1 = { class: "icon-button-container" };
const _hoisted_2 = { class: "title" };
const _hoisted_3 = { class: "title" };
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "IconButton",
props: {
title: { default: "" },
hasMore: { type: Boolean, default: false },
hideHoverEffect: { type: Boolean, default: false },
disabled: { type: Boolean, default: false },
isActive: { type: Boolean, default: false },
layout: { default: IconButtonLayout.VERTICAl },
icon: { default: null },
isNotSupport: { type: Boolean, default: false }
},
emits: ["click-icon", "click-more"],
setup(__props, { emit: __emit }) {
const props = __props;
const emit = __emit;
const iconContentClass = computed(() => {
if (props.layout === IconButtonLayout.HORIZONTAL) {
return "icon-content-horizontal";
}
return "icon-content-vertical";
});
const handleClickEvent = () => {
emit("click-icon");
};
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1, [
unref(isMobile) ? withDirectives((openBlock(), createElementBlock("div", {
key: 0,
class: normalizeClass(["icon-content", iconContentClass.value, `${_ctx.disabled && "disabled"}`])
}, [
renderSlot(_ctx.$slots, "default", {}, void 0, true),
_ctx.icon ? (openBlock(), createBlock(unref(TUIIcon), {
key: 0,
icon: _ctx.icon
}, null, 8, ["icon"])) : createCommentVNode("", true),
createElementVNode("span", _hoisted_2, toDisplayString(_ctx.title), 1)
], 2)), [
[unref(vTap), handleClickEvent]
]) : (openBlock(), createElementBlock("div", {
key: 1,
class: normalizeClass(["icon-content", iconContentClass.value, `${_ctx.disabled && "disabled"}`]),
onClick: handleClickEvent
}, [
renderSlot(_ctx.$slots, "default", {}, void 0, true),
_ctx.icon ? (openBlock(), createBlock(unref(TUIIcon), {
key: 0,
icon: _ctx.icon
}, null, 8, ["icon"])) : createCommentVNode("", true),
_ctx.isNotSupport ? (openBlock(), createBlock(unref(IconUnSupport), {
key: 1,
class: "unsupport-icon",
size: "14"
})) : createCommentVNode("", true),
createElementVNode("span", _hoisted_3, [
createTextVNode(toDisplayString(_ctx.title) + " ", 1),
renderSlot(_ctx.$slots, "title", {}, void 0, true)
])
], 2)),
_ctx.hasMore ? (openBlock(), createElementBlock("div", {
key: 2,
ref: "moreSpanRef",
class: "icon-arrow",
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click-more"))
}, [
createVNode(unref(IconArrowUp), { size: "12" })
], 512)) : createCommentVNode("", true)
]);
};
}
});
export {
_sfc_main as default
};