8e39e51f156b7e6c018e57f0eb68cfe0cc65c49ad23b538104b90cbb7ea5e587de9527527e2623b1ca0555e41535817da78ad0b0cbe73d9a5142d6df39ba0a 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. var vue = require('vue');
  4. var checkTag = require('./check-tag.js');
  5. var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
  6. var index = require('../../../hooks/use-namespace/index.js');
  7. var event = require('../../../constants/event.js');
  8. const __default__ = vue.defineComponent({
  9. name: "ElCheckTag"
  10. });
  11. const _sfc_main = /* @__PURE__ */ vue.defineComponent({
  12. ...__default__,
  13. props: checkTag.checkTagProps,
  14. emits: checkTag.checkTagEmits,
  15. setup(__props, { emit }) {
  16. const props = __props;
  17. const ns = index.useNamespace("check-tag");
  18. const isDisabled = vue.computed(() => props.disabled);
  19. const containerKls = vue.computed(() => [
  20. ns.b(),
  21. ns.is("checked", props.checked),
  22. ns.is("disabled", isDisabled.value),
  23. ns.m(props.type || "primary")
  24. ]);
  25. const handleChange = () => {
  26. if (isDisabled.value)
  27. return;
  28. const checked = !props.checked;
  29. emit(event.CHANGE_EVENT, checked);
  30. emit("update:checked", checked);
  31. };
  32. return (_ctx, _cache) => {
  33. return vue.openBlock(), vue.createElementBlock("span", {
  34. class: vue.normalizeClass(vue.unref(containerKls)),
  35. onClick: handleChange
  36. }, [
  37. vue.renderSlot(_ctx.$slots, "default")
  38. ], 2);
  39. };
  40. }
  41. });
  42. var CheckTag = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "check-tag.vue"]]);
  43. exports["default"] = CheckTag;
  44. //# sourceMappingURL=check-tag2.js.map