nav-bar.vue 1013 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <view>
  3. <u-navbar :is-back="showBackBtn" :title="title" z-index="99999999999999">
  4. <view class="slot-wrap">
  5. <img class="homeIcon" src="@/static/modIcon/home-1.png" alt="" v-if="showHomeBtn"
  6. @click="goHome()">
  7. </view>
  8. </u-navbar>
  9. </view>
  10. </template>
  11. <script>
  12. export default {
  13. name: "navBar",
  14. props: {
  15. statusBar: {
  16. type: Boolean,
  17. default: true,
  18. },
  19. title: {
  20. type: String,
  21. default: "",
  22. },
  23. showBackBtn: {
  24. type: Boolean,
  25. default: true,
  26. },
  27. showHomeBtn: {
  28. type: Boolean,
  29. default: true,
  30. },
  31. },
  32. components: {},
  33. data() {
  34. return {};
  35. },
  36. onLoad() {},
  37. created() {},
  38. mounted() {},
  39. onPageShow() {},
  40. methods: {
  41. goHome() {
  42. uni.switchTab({
  43. url: "/pages/index/index",
  44. });
  45. },
  46. },
  47. };
  48. </script>
  49. <style scoped lang="scss">
  50. .homeIcon {
  51. margin-left: 20rpx;
  52. width: 42rpx;
  53. height: 42rpx;
  54. }
  55. .slot-wrap {
  56. display: flex;
  57. align-items: center;
  58. }
  59. </style>