cione-comp-lib
Version:
`$ yarn add cione-comp-lib` 或者 `$ npm i cione-comp-lib -S`
45 lines (44 loc) • 1.68 kB
JavaScript
import CheckIcon from "../icons/CheckIcon.mjs";
import { resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, withModifiers, mergeProps, createBlock, createCommentVNode, toDisplayString } from "vue";
import style0 from "./Checkbox.vue_used_vue_type_style_index_0_lang.module.mjs";
import _export_sfc from "../../../../_virtual/plugin-vue_export-helper.mjs";
const _sfc_main = {
name: "Checkbox",
inheritAttrs: false,
props: {
label: {
type: String,
required: true
}
},
components: {
CheckIcon
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
const _component_CheckIcon = resolveComponent("CheckIcon");
return openBlock(), createElementBlock("div", {
class: normalizeClass(_ctx.$style.checkbox)
}, [
createElementVNode("label", {
class: normalizeClass({ [_ctx.$style.disabled]: _ctx.$attrs.disabled }),
onContextmenu: _cache[0] || (_cache[0] = withModifiers(() => {
}, ["prevent"]))
}, [
createElementVNode("input", mergeProps(_ctx.$attrs, { type: "checkbox" }), null, 16),
createElementVNode("span", {
class: normalizeClass(_ctx.$style.overlay)
}, [
_ctx.$attrs.checked ? (openBlock(), createBlock(_component_CheckIcon, { key: 0 })) : createCommentVNode("", true)
], 2),
createElementVNode("span", {
class: normalizeClass(_ctx.$style.label)
}, toDisplayString($props.label), 3)
], 34)
], 2);
}
const cssModules = {
"$style": style0
};
var Checkbox = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__cssModules", cssModules]]);
export { Checkbox as default };