@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,
58 lines (57 loc) • 1.6 kB
JavaScript
"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const Vue = require("vue");
const _hoisted_1 = ["value", "disabled"];
const _sfc_main = /* @__PURE__ */ Vue.defineComponent({
__name: "OptionH5",
props: {
label: {
type: String,
required: true
},
value: {
required: true,
type: [String, Number]
},
disabled: {
type: Boolean,
default: false
}
},
setup(__props) {
const optionRef = Vue.ref();
const TSelect = Vue.inject("TSelect");
const props = __props;
const isActive = Vue.computed(() => {
return TSelect && TSelect.label.value === props.label;
});
Vue.watch(
() => props.label,
(newValue) => {
TSelect.addOption({
label: props.label,
value: props.value,
ref: optionRef
});
}
);
Vue.onMounted(() => {
TSelect.addOption({ label: props.label, value: props.value, ref: optionRef });
});
const handleOptionClick = () => {
if (props.disabled) return;
TSelect.handleOptionClick(props.value);
};
return (_ctx, _cache) => {
return Vue.openBlock(), Vue.createElementBlock("span", Vue.mergeProps({
class: ["custom-option", isActive.value && "active"],
value: props.value,
disabled: __props.disabled,
onClick: handleOptionClick,
ref_key: "optionRef",
ref: optionRef
}, _ctx.$attrs), Vue.toDisplayString(props.label), 17, _hoisted_1);
};
}
});
exports.default = _sfc_main;