@tencentcloud/roomkit-electron-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,
53 lines (52 loc) • 1.68 kB
JavaScript
import { defineComponent, ref, watch, createElementBlock, openBlock, withDirectives, createElementVNode, vModelCheckbox, renderSlot } from "vue";
const _hoisted_1 = { class: "tui-checkbox" };
const _hoisted_2 = ["disabled"];
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "index",
props: {
modelValue: { type: Boolean, default: false },
disabled: { type: Boolean, default: false }
},
emits: ["input"],
setup(__props, { emit: __emit }) {
const props = __props;
const checked = ref(props.modelValue);
const emit = __emit;
watch(
() => props.modelValue,
(value) => {
checked.value = props.disabled ? true : value;
},
{ immediate: true }
);
function handleCheckBoxClick() {
checked.value = !checked.value;
emit("input", checked.value);
}
function handleValueChange(event) {
checked.value = event.target.checked;
emit("input", event.target.checked);
}
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1, [
withDirectives(createElementVNode("input", {
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => checked.value = $event),
type: "checkbox",
disabled: props.disabled,
onChange: handleValueChange
}, null, 40, _hoisted_2), [
[vModelCheckbox, checked.value]
]),
createElementVNode("span", {
class: "tui-checkbox-slot-container",
onClick: handleCheckBoxClick
}, [
renderSlot(_ctx.$slots, "default", {}, void 0, true)
])
]);
};
}
});
export {
_sfc_main as default
};