erp-nav-bar.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. "use strict";
  2. const common_vendor = require("../common/vendor.js");
  3. const _sfc_main = {
  4. name: "ErpNavBar",
  5. props: {
  6. title: { type: String, default: "" },
  7. showBack: { type: Boolean, default: true },
  8. bgColor: { type: String, default: "#ffffff" },
  9. titleColor: { type: String, default: "#333333" }
  10. },
  11. data() {
  12. return { statusBarHeight: 20 };
  13. },
  14. mounted() {
  15. this.statusBarHeight = common_vendor.index.getSystemInfoSync().statusBarHeight || 20;
  16. },
  17. methods: {
  18. handleBack() {
  19. if (this.showBack) {
  20. this.$emit("back");
  21. common_vendor.index.navigateBack();
  22. }
  23. }
  24. }
  25. };
  26. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  27. return common_vendor.e({
  28. a: $props.showBack
  29. }, $props.showBack ? {
  30. b: $props.titleColor
  31. } : {}, {
  32. c: common_vendor.o((...args) => $options.handleBack && $options.handleBack(...args), "6f"),
  33. d: common_vendor.t($props.title),
  34. e: $props.titleColor,
  35. f: $data.statusBarHeight + "px",
  36. g: $props.bgColor
  37. });
  38. }
  39. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-1c584cd2"]]);
  40. wx.createComponent(Component);
  41. //# sourceMappingURL=../../.sourcemap/mp-weixin/components/erp-nav-bar.js.map