UNPKG

@tencentcloud/ai-desk-customer-wechat

Version:

AI Desk customer UIKit for wechat mini program

57 lines (56 loc) 1.85 kB
"use strict"; const common_vendor = require("../../../common/vendor.js"); const aiDeskCustomerUniapp_adapterVue = require("../../adapter-vue.js"); const aiDeskCustomerUniapp_utils_env = require("../../utils/env.js"); const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({ __name: "Icon", props: { file: { default: "" }, size: {}, width: { default: "20px" }, height: { default: "20px" }, hotAreaSize: {} }, emits: ["onClick"], setup(__props, { emit: __emit }) { const { withDefaults, computed } = aiDeskCustomerUniapp_adapterVue.vue; const emits = __emit; const props = __props; const iconHotAreaSize = computed(() => { if (!props.hotAreaSize) { return void 0; } if (isNaN(Number(props.hotAreaSize))) { return String(props.hotAreaSize); } return `${props.hotAreaSize}px`; }); const iconWidth = computed(() => { return props.size ? props.size : props.width; }); const iconHeight = computed(() => { return props.size ? props.size : props.height; }); const handleImgClick = (e) => { emits("onClick", e); }; return (_ctx, _cache) => { return common_vendor.e({ a: common_vendor.unref(aiDeskCustomerUniapp_utils_env.isApp) }, common_vendor.unref(aiDeskCustomerUniapp_utils_env.isApp) ? { b: props.file, c: common_vendor.unref(iconWidth), d: common_vendor.unref(iconHeight) } : { e: props.file, f: common_vendor.unref(iconWidth), g: common_vendor.unref(iconHeight) }, { h: common_vendor.unref(iconHotAreaSize), i: common_vendor.o(handleImgClick) }); }; } }); const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-419ed793"]]); wx.createComponent(Component);