yuang-framework-ui-pc
Version:
yuang-framework-ui-pc Library
49 lines (48 loc) • 1.48 kB
JavaScript
"use strict";
const vue = require("vue");
const elementPlus = require("element-plus");
const _sfc_main = vue.defineComponent({
name: "CellCheckbox",
components: { ElCheckbox: elementPlus.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 = vue.resolveComponent("ElCheckbox");
return vue.openBlock(), vue.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]]);
module.exports = cellCheckbox;