su-switch.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. "use strict";
  2. const common_vendor = require("../../../common/vendor.js");
  3. const __default__ = {
  4. name: "UiSwitch"
  5. };
  6. const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
  7. props: {
  8. modelValue: {
  9. type: [Boolean, Number],
  10. default: false
  11. },
  12. ui: {
  13. type: String,
  14. default: ""
  15. },
  16. bg: {
  17. type: String,
  18. default: "ui-BG-Main"
  19. },
  20. text: {
  21. type: String,
  22. default: ""
  23. },
  24. size: {
  25. type: String,
  26. default: "sm"
  27. },
  28. disabled: {
  29. type: Boolean,
  30. default: false
  31. }
  32. },
  33. emits: ["update:modelValue"],
  34. setup(__props, { emit: emits }) {
  35. const props = __props;
  36. const change = () => {
  37. emits("update:modelValue", !props.modelValue);
  38. };
  39. return (_ctx, _cache) => {
  40. return {
  41. a: common_vendor.n({
  42. "ui-switch-input-checked": props.modelValue
  43. }),
  44. b: common_vendor.n(props.modelValue ? props.bg : ""),
  45. c: common_vendor.n(props.text),
  46. d: common_vendor.n(props.size),
  47. e: common_vendor.o(change),
  48. f: common_vendor.n({
  49. disabled: props.disabled
  50. }),
  51. g: common_vendor.n(props.ui)
  52. };
  53. };
  54. }
  55. });
  56. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-8eb57d65"], ["__file", "/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-app/sheep/ui/su-switch/su-switch.vue"]]);
  57. wx.createComponent(Component);