u-cell.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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$4],
  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.disabled && "u-cell--disabled"),
  57. h: common_vendor.n(_ctx.size === "large" && "u-cell__title-text--large")
  58. }, {
  59. i: _ctx.label
  60. }, _ctx.label ? {
  61. j: common_vendor.t(_ctx.label),
  62. k: common_vendor.n(_ctx.disabled && "u-cell--disabled"),
  63. l: common_vendor.n(_ctx.size === "large" && "u-cell__label--large")
  64. } : {}, {
  65. m: !$options.testEmpty(_ctx.value)
  66. }, !$options.testEmpty(_ctx.value) ? {
  67. n: common_vendor.t(_ctx.value),
  68. o: common_vendor.n(_ctx.disabled && "u-cell--disabled"),
  69. p: common_vendor.n(_ctx.size === "large" && "u-cell__value--large")
  70. } : {}, {
  71. q: _ctx.$slots["right-icon"] || _ctx.isLink
  72. }, _ctx.$slots["right-icon"] || _ctx.isLink ? common_vendor.e({
  73. r: _ctx.rightIcon && !_ctx.$slots["right-icon"]
  74. }, _ctx.rightIcon && !_ctx.$slots["right-icon"] ? {
  75. s: common_vendor.p({
  76. name: _ctx.rightIcon,
  77. ["custom-style"]: _ctx.rightIconStyle,
  78. color: _ctx.disabled ? "#c8c9cc" : "info",
  79. size: _ctx.size === "large" ? 18 : 16
  80. })
  81. } : {}, {
  82. t: common_vendor.n(`u-cell__right-icon-wrap--${_ctx.arrowDirection}`)
  83. }) : {}, {
  84. v: _ctx.$slots["righticon"]
  85. }, _ctx.$slots["righticon"] ? {
  86. w: common_vendor.n(`u-cell__right-icon-wrap--${_ctx.arrowDirection}`)
  87. } : {}, {
  88. x: common_vendor.n(_ctx.center && "u-cell--center"),
  89. y: common_vendor.n(_ctx.size === "large" && "u-cell__body--large"),
  90. z: _ctx.border
  91. }, _ctx.border ? {} : {}, {
  92. A: common_vendor.n(_ctx.customClass),
  93. B: common_vendor.s($options.addStyle(_ctx.customStyle)),
  94. C: !_ctx.disabled && (_ctx.clickable || _ctx.isLink) ? "u-cell--clickable" : "",
  95. D: common_vendor.o((...args) => $options.clickHandler && $options.clickHandler(...args))
  96. });
  97. }
  98. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-b4243719"], ["__file", "D:/project/学吧/learn_applet/node_modules/uview-plus/components/u-cell/u-cell.vue"]]);
  99. wx.createComponent(Component);