yuang-framework-ui-pc
Version:
yuang-framework-ui-pc Library
50 lines (49 loc) • 1.48 kB
JavaScript
import { defineComponent, resolveComponent, openBlock, createBlock } from "vue";
import { ElCheckbox } from "element-plus";
const _sfc_main = defineComponent({
name: "CellCheckbox",
components: { ElCheckbox },
props: {
/** 是否是选中状态 */
checked: Boolean,
/** 是否是半选状态 */
indeterminate: Boolean,
/** 是否是禁用状态 */
disabled: Boolean,
/** 尺寸 */
size: String
},
emits: {
/** 选中改变事件 */
change: (_checked) => true
},
setup(props, { emit }) {
const handleUpdateModelValue = (modelValue) => {
if (props.checked !== modelValue) {
emit("change", modelValue);
}
};
return { handleUpdateModelValue };
}
});
const _export_sfc = (sfc, props) => {
const target = sfc.__vccOpts || sfc;
for (const [key, val] of props) {
target[key] = val;
}
return target;
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
const _component_ElCheckbox = resolveComponent("ElCheckbox");
return openBlock(), createBlock(_component_ElCheckbox, {
modelValue: _ctx.checked,
indeterminate: _ctx.indeterminate,
disabled: _ctx.disabled,
size: _ctx.size,
"onUpdate:modelValue": _ctx.handleUpdateModelValue
}, null, 8, ["modelValue", "indeterminate", "disabled", "size", "onUpdate:modelValue"]);
}
const cellCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
export {
cellCheckbox as default
};