nav-bar.vue 967 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <view>
  3. <u-navbar :is-back="showBackBtn" :title="title">
  4. <view class="slot-wrap">
  5. <u-icon class="homeIcon" v-if="showHomeBtn" @click="goHome()" name="home" size="40"></u-icon>
  6. </view>
  7. </u-navbar>
  8. </view>
  9. </template>
  10. <script>
  11. import { mapGetters } from 'vuex';
  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. },
  34. data() {
  35. return {
  36. };
  37. },
  38. onLoad() {},
  39. created() {
  40. },
  41. mounted() {
  42. },
  43. onPageShow() {
  44. },
  45. methods: {
  46. goHome() {
  47. uni.switchTab({
  48. url: '/pages/index/index'
  49. });
  50. }
  51. },
  52. computed: { ...mapGetters(['goodsAuditionConfigIdList']) },
  53. };
  54. </script>
  55. <style scoped lang="scss">
  56. .homeIcon {
  57. margin-left:20rpx;
  58. }
  59. .slot-wrap {
  60. display: flex;
  61. align-items: center;
  62. }
  63. </style>