element-plus
Version:
A Component Library for Vue 3
34 lines (31 loc) • 1.04 kB
JavaScript
import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, renderSlot } from 'vue';
import '../../../hooks/index.mjs';
import { checkTagProps, checkTagEmits } from './check-tag.mjs';
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
const __default__ = {
name: "ElCheckTag"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
...__default__,
props: checkTagProps,
emits: checkTagEmits,
setup(__props, { emit }) {
const props = __props;
const ns = useNamespace("check-tag");
const handleChange = () => {
const checked = !props.checked;
emit("change", checked);
emit("update:checked", checked);
};
return (_ctx, _cache) => {
return openBlock(), createElementBlock("span", {
class: normalizeClass([unref(ns).b(), unref(ns).is("checked", _ctx.checked)]),
onClick: handleChange
}, [
renderSlot(_ctx.$slots, "default")
], 2);
};
}
});
export { _sfc_main as default };
//# sourceMappingURL=check-tag2.mjs.map