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,

36 lines (35 loc) 948 B
import { defineComponent, computed, ref, createElementBlock, openBlock, createElementVNode } from "vue"; import defaultAvatar from "../../assets/imgs/avatar.png.mjs"; const _hoisted_1 = { class: "avatar-container" }; const _hoisted_2 = ["src"]; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "Avatar", props: { imgSrc: {} }, setup(__props) { const props = __props; const src = computed(() => { if (isError.value) { return defaultAvatar; } return props.imgSrc || defaultAvatar; }); const isError = ref(false); function handleError() { isError.value = true; } return (_ctx, _cache) => { return openBlock(), createElementBlock("div", _hoisted_1, [ createElementVNode("img", { class: "avatar", src: src.value, onerror: handleError }, null, 8, _hoisted_2) ]); }; } }); export { _sfc_main as default };