uni-section.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const _sfc_main = {
  4. name: "UniSection",
  5. emits: ["click"],
  6. props: {
  7. type: {
  8. type: String,
  9. default: ""
  10. },
  11. title: {
  12. type: String,
  13. required: true,
  14. default: ""
  15. },
  16. titleFontSize: {
  17. type: String,
  18. default: "14px"
  19. },
  20. titleColor: {
  21. type: String,
  22. default: "#333"
  23. },
  24. subTitle: {
  25. type: String,
  26. default: ""
  27. },
  28. subTitleFontSize: {
  29. type: String,
  30. default: "12px"
  31. },
  32. subTitleColor: {
  33. type: String,
  34. default: "#999"
  35. },
  36. padding: {
  37. type: [Boolean, String],
  38. default: false
  39. }
  40. },
  41. computed: {
  42. _padding() {
  43. if (typeof this.padding === "string") {
  44. return this.padding;
  45. }
  46. return this.padding ? "10px" : "";
  47. }
  48. },
  49. watch: {
  50. title(newVal) {
  51. if (common_vendor.index.report && newVal !== "") {
  52. common_vendor.index.report("title", newVal);
  53. }
  54. }
  55. },
  56. methods: {
  57. onClick() {
  58. this.$emit("click");
  59. }
  60. }
  61. };
  62. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  63. return common_vendor.e({
  64. a: $props.type
  65. }, $props.type ? {
  66. b: common_vendor.n($props.type)
  67. } : {}, {
  68. c: common_vendor.t($props.title),
  69. d: $props.titleFontSize,
  70. e: $props.titleColor,
  71. f: !$props.subTitle ? 1 : "",
  72. g: $props.subTitle
  73. }, $props.subTitle ? {
  74. h: common_vendor.t($props.subTitle),
  75. i: $props.subTitleFontSize,
  76. j: $props.subTitleColor
  77. } : {}, {
  78. k: common_vendor.o((...args) => $options.onClick && $options.onClick(...args)),
  79. l: $options._padding
  80. });
  81. }
  82. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "C:/Users/Administrator/Desktop/srcaaa/components/uni-section/uni-section.vue"]]);
  83. wx.createComponent(Component);