u-column-notice.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. "use strict";
  2. const common_vendor = require("../../../../common/vendor.js");
  3. const _sfc_main = {
  4. mixins: [common_vendor.mpMixin, common_vendor.mixin, common_vendor.props$17],
  5. watch: {
  6. text: {
  7. immediate: true,
  8. handler(newValue, oldValue) {
  9. if (!common_vendor.index.$u.test.array(newValue)) {
  10. common_vendor.index.$u.error("noticebar组件direction为column时,要求text参数为数组形式");
  11. }
  12. }
  13. }
  14. },
  15. computed: {
  16. // 文字内容的样式
  17. textStyle() {
  18. let style = {};
  19. style.color = this.color;
  20. style.fontSize = common_vendor.index.$u.addUnit(this.fontSize);
  21. return style;
  22. },
  23. // 垂直或者水平滚动
  24. vertical() {
  25. if (this.mode == "horizontal")
  26. return false;
  27. else
  28. return true;
  29. }
  30. },
  31. data() {
  32. return {
  33. index: 0
  34. };
  35. },
  36. emits: ["click", "close"],
  37. methods: {
  38. noticeChange(e) {
  39. this.index = e.detail.current;
  40. },
  41. // 点击通告栏
  42. clickHandler() {
  43. this.$emit("click", this.index);
  44. },
  45. // 点击关闭按钮
  46. close() {
  47. this.$emit("close");
  48. }
  49. }
  50. };
  51. if (!Array) {
  52. const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
  53. _easycom_u_icon2();
  54. }
  55. const _easycom_u_icon = () => "../u-icon/u-icon.js";
  56. if (!Math) {
  57. _easycom_u_icon();
  58. }
  59. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  60. return common_vendor.e({
  61. a: _ctx.icon
  62. }, _ctx.icon ? {
  63. b: common_vendor.p({
  64. name: _ctx.icon,
  65. color: _ctx.color,
  66. size: "19"
  67. })
  68. } : {}, {
  69. c: common_vendor.f(_ctx.text, (item, index, i0) => {
  70. return {
  71. a: common_vendor.t(item),
  72. b: index
  73. };
  74. }),
  75. d: common_vendor.s($options.textStyle),
  76. e: _ctx.disableTouch,
  77. f: _ctx.step ? false : true,
  78. g: _ctx.duration,
  79. h: common_vendor.o((...args) => $options.noticeChange && $options.noticeChange(...args)),
  80. i: ["link", "closable"].includes(_ctx.mode)
  81. }, ["link", "closable"].includes(_ctx.mode) ? common_vendor.e({
  82. j: _ctx.mode === "link"
  83. }, _ctx.mode === "link" ? {
  84. k: common_vendor.p({
  85. name: "arrow-right",
  86. size: 17,
  87. color: _ctx.color
  88. })
  89. } : {}, {
  90. l: _ctx.mode === "closable"
  91. }, _ctx.mode === "closable" ? {
  92. m: common_vendor.o($options.close),
  93. n: common_vendor.p({
  94. name: "close",
  95. size: 16,
  96. color: _ctx.color
  97. })
  98. } : {}) : {}, {
  99. o: common_vendor.o((...args) => $options.clickHandler && $options.clickHandler(...args))
  100. });
  101. }
  102. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-6c9dce4e"], ["__file", "D:/project/赋强公证/notarization_applet/node_modules/uview-plus/components/u-column-notice/u-column-notice.vue"]]);
  103. wx.createComponent(Component);