su-switch.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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: __emit }) {
  35. const props = __props;
  36. const emits = __emit;
  37. const change = () => {
  38. emits("update:modelValue", !props.modelValue);
  39. };
  40. return (_ctx, _cache) => {
  41. return {
  42. a: common_vendor.n({
  43. "ui-switch-input-checked": props.modelValue
  44. }),
  45. b: common_vendor.n(props.modelValue ? props.bg : ""),
  46. c: common_vendor.n(props.text),
  47. d: common_vendor.n(props.size),
  48. e: common_vendor.o(change),
  49. f: common_vendor.n({
  50. disabled: props.disabled
  51. }),
  52. g: common_vendor.n(props.ui)
  53. };
  54. };
  55. }
  56. });
  57. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-8eb57d65"], ["__file", "D:/zx/mall-front-app/sheep/ui/su-switch/su-switch.vue"]]);
  58. wx.createComponent(Component);