@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,
32 lines (31 loc) • 1 kB
JavaScript
import { defineComponent, ref, computed, onMounted, onUnmounted, createElementBlock, openBlock, toDisplayString } from "vue";
const _hoisted_1 = { class: "timing" };
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "RoomTime",
setup(__props) {
const meetingTime = ref(0);
let intervalId = null;
const formattedTime = computed(() => {
const minutes = Math.floor(meetingTime.value / 60);
const seconds = meetingTime.value % 60;
return `${minutes.toString().padStart(2, "0")}:${seconds.toString().padStart(2, "0")}`;
});
function startTimer() {
intervalId = setInterval(() => {
meetingTime.value += 1;
}, 1e3);
}
onMounted(() => {
startTimer();
});
onUnmounted(() => {
intervalId && clearInterval(intervalId);
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1, toDisplayString(formattedTime.value), 1);
};
}
});
export {
_sfc_main as default
};