u-navbar.js 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. "use strict";
  2. const common_vendor = require("../../../../common/vendor.js");
  3. const _sfc_main = {
  4. name: "u-navbar",
  5. mixins: [common_vendor.mpMixin, common_vendor.mixin, common_vendor.props$8],
  6. data() {
  7. return {};
  8. },
  9. emits: ["leftClick", "rightClick"],
  10. methods: {
  11. addStyle: common_vendor.addStyle,
  12. addUnit: common_vendor.addUnit,
  13. getWindowInfo: common_vendor.getWindowInfo,
  14. getPx: common_vendor.getPx,
  15. // 点击左侧区域
  16. leftClick() {
  17. this.$emit("leftClick");
  18. if (common_vendor.config.interceptor.navbarLeftClick != null) {
  19. common_vendor.config.interceptor.navbarLeftClick();
  20. } else {
  21. if (this.autoBack) {
  22. common_vendor.index.navigateBack();
  23. }
  24. }
  25. },
  26. // 点击右侧区域
  27. rightClick() {
  28. this.$emit("rightClick");
  29. }
  30. }
  31. };
  32. if (!Array) {
  33. const _easycom_u_status_bar2 = common_vendor.resolveComponent("u-status-bar");
  34. const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
  35. (_easycom_u_status_bar2 + _easycom_u_icon2)();
  36. }
  37. const _easycom_u_status_bar = () => "../u-status-bar/u-status-bar.js";
  38. const _easycom_u_icon = () => "../u-icon/u-icon.js";
  39. if (!Math) {
  40. (_easycom_u_status_bar + _easycom_u_icon)();
  41. }
  42. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  43. return common_vendor.e({
  44. a: _ctx.fixed && _ctx.placeholder
  45. }, _ctx.fixed && _ctx.placeholder ? {
  46. b: $options.addUnit($options.getPx(_ctx.height) + $options.getWindowInfo().statusBarHeight, "px")
  47. } : {}, {
  48. c: _ctx.safeAreaInsetTop
  49. }, _ctx.safeAreaInsetTop ? {
  50. d: common_vendor.p({
  51. bgColor: _ctx.bgColor
  52. })
  53. } : {}, {
  54. e: _ctx.leftIcon
  55. }, _ctx.leftIcon ? {
  56. f: common_vendor.p({
  57. name: _ctx.leftIcon,
  58. size: _ctx.leftIconSize,
  59. color: _ctx.leftIconColor
  60. })
  61. } : {}, {
  62. g: _ctx.leftText
  63. }, _ctx.leftText ? {
  64. h: common_vendor.t(_ctx.leftText),
  65. i: _ctx.leftIconColor
  66. } : {}, {
  67. j: common_vendor.o((...args) => $options.leftClick && $options.leftClick(...args)),
  68. k: common_vendor.t(_ctx.title),
  69. l: common_vendor.s({
  70. width: $options.addUnit(_ctx.titleWidth),
  71. color: _ctx.titleColor
  72. }),
  73. m: common_vendor.s($options.addStyle(_ctx.titleStyle)),
  74. n: _ctx.$slots.right || _ctx.rightIcon || _ctx.rightText
  75. }, _ctx.$slots.right || _ctx.rightIcon || _ctx.rightText ? common_vendor.e({
  76. o: _ctx.rightIcon
  77. }, _ctx.rightIcon ? {
  78. p: common_vendor.p({
  79. name: _ctx.rightIcon,
  80. size: "20"
  81. })
  82. } : {}, {
  83. q: _ctx.rightText
  84. }, _ctx.rightText ? {
  85. r: common_vendor.t(_ctx.rightText)
  86. } : {}, {
  87. s: common_vendor.o((...args) => $options.rightClick && $options.rightClick(...args))
  88. }) : {}, {
  89. t: common_vendor.n(_ctx.border && "u-border-bottom"),
  90. v: $options.addUnit(_ctx.height),
  91. w: _ctx.bgColor,
  92. x: common_vendor.n(_ctx.fixed && "u-navbar--fixed"),
  93. y: common_vendor.n(_ctx.customClass)
  94. });
  95. }
  96. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-9d9e7ee2"], ["__file", "C:/Users/Administrator/Desktop/srcaaa/node_modules/uview-plus/components/u-navbar/u-navbar.vue"]]);
  97. wx.createComponent(Component);