u-cell.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. "use strict";
  2. const common_vendor = require("../../../../common/vendor.js");
  3. const _sfc_main = {
  4. name: "u-cell",
  5. data() {
  6. return {};
  7. },
  8. mixins: [common_vendor.mpMixin, common_vendor.mixin, common_vendor.props$9],
  9. computed: {
  10. titleTextStyle() {
  11. return common_vendor.addStyle(this.titleStyle);
  12. }
  13. },
  14. emits: ["click"],
  15. methods: {
  16. addStyle: common_vendor.addStyle,
  17. testEmpty: common_vendor.test.empty,
  18. // 点击cell
  19. clickHandler(e) {
  20. if (this.disabled)
  21. return;
  22. this.$emit("click", {
  23. name: this.name
  24. });
  25. this.openPage();
  26. this.stop && this.preventEvent(e);
  27. }
  28. }
  29. };
  30. if (!Array) {
  31. const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
  32. const _easycom_u_line2 = common_vendor.resolveComponent("u-line");
  33. (_easycom_u_icon2 + _easycom_u_line2)();
  34. }
  35. const _easycom_u_icon = () => "../u-icon/u-icon.js";
  36. const _easycom_u_line = () => "../u-line/u-line.js";
  37. if (!Math) {
  38. (_easycom_u_icon + _easycom_u_line)();
  39. }
  40. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  41. return common_vendor.e({
  42. a: _ctx.$slots.icon || _ctx.icon
  43. }, _ctx.$slots.icon || _ctx.icon ? common_vendor.e({
  44. b: _ctx.$slots.icon
  45. }, _ctx.$slots.icon ? {} : {
  46. c: common_vendor.p({
  47. name: _ctx.icon,
  48. ["custom-style"]: _ctx.iconStyle,
  49. size: _ctx.size === "large" ? 22 : 18
  50. })
  51. }) : {}, {
  52. d: _ctx.$slots.title || !_ctx.title
  53. }, _ctx.$slots.title || !_ctx.title ? {} : {
  54. e: common_vendor.t(_ctx.title),
  55. f: common_vendor.s($options.titleTextStyle),
  56. g: common_vendor.n(_ctx.required && "u-cell--required"),
  57. h: common_vendor.n(_ctx.disabled && "u-cell--disabled"),
  58. i: common_vendor.n(_ctx.size === "large" && "u-cell__title-text--large")
  59. }, {
  60. j: _ctx.label
  61. }, _ctx.label ? {
  62. k: common_vendor.t(_ctx.label),
  63. l: common_vendor.n(_ctx.disabled && "u-cell--disabled"),
  64. m: common_vendor.n(_ctx.size === "large" && "u-cell__label--large")
  65. } : {}, {
  66. n: !$options.testEmpty(_ctx.value)
  67. }, !$options.testEmpty(_ctx.value) ? {
  68. o: common_vendor.t(_ctx.value),
  69. p: common_vendor.n(_ctx.disabled && "u-cell--disabled"),
  70. q: common_vendor.n(_ctx.size === "large" && "u-cell__value--large")
  71. } : {}, {
  72. r: _ctx.$slots["right-icon"] || _ctx.isLink
  73. }, _ctx.$slots["right-icon"] || _ctx.isLink ? common_vendor.e({
  74. s: _ctx.rightIcon && !_ctx.$slots["right-icon"]
  75. }, _ctx.rightIcon && !_ctx.$slots["right-icon"] ? {
  76. t: common_vendor.p({
  77. name: _ctx.rightIcon,
  78. ["custom-style"]: _ctx.rightIconStyle,
  79. color: _ctx.disabled ? "#c8c9cc" : "info",
  80. size: _ctx.size === "large" ? 18 : 16
  81. })
  82. } : {}, {
  83. v: common_vendor.n(`u-cell__right-icon-wrap--${_ctx.arrowDirection}`)
  84. }) : {}, {
  85. w: _ctx.$slots["righticon"]
  86. }, _ctx.$slots["righticon"] ? {
  87. x: common_vendor.n(`u-cell__right-icon-wrap--${_ctx.arrowDirection}`)
  88. } : {}, {
  89. y: common_vendor.n(_ctx.center && "u-cell--center"),
  90. z: common_vendor.n(_ctx.size === "large" && "u-cell__body--large"),
  91. A: _ctx.border
  92. }, _ctx.border ? {} : {}, {
  93. B: common_vendor.n(_ctx.customClass),
  94. C: common_vendor.s($options.addStyle(_ctx.customStyle)),
  95. D: !_ctx.disabled && (_ctx.clickable || _ctx.isLink) ? "u-cell--clickable" : "",
  96. E: common_vendor.o((...args) => $options.clickHandler && $options.clickHandler(...args))
  97. });
  98. }
  99. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-b4243719"], ["__file", "C:/Users/Administrator/Desktop/srcaaa/node_modules/uview-plus/components/u-cell/u-cell.vue"]]);
  100. wx.createComponent(Component);