index.vue 916 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <view class="header-bar">
  3. <view class="">
  4. <uni-icons type="back" size="30" @click="backFn"></uni-icons>
  5. </view>
  6. <view class="text">
  7. {{title || '导航'}}
  8. </view>
  9. <view class="">
  10. <uni-icons type="plusempty" @click.native="toAdd()" v-if="addUrl" size="30"></uni-icons>
  11. <uni-icons type="bars" size="30"></uni-icons>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. export default{
  17. name:"header-bar",
  18. props:{
  19. title:{
  20. type: String,
  21. },
  22. addUrl:{
  23. type: String,
  24. }
  25. },
  26. methods:{
  27. backFn(){
  28. uni.navigateBack({
  29. delta:1,//返回层数,2则上上页
  30. })
  31. },
  32. toAdd(){
  33. uni.navigateTo({
  34. url:'/pages/supplyChain' + this.addUrl
  35. })
  36. },
  37. },
  38. }
  39. </script>
  40. <style lang="less">
  41. .header-bar{
  42. height: 100rpx;
  43. line-height: 100rpx;
  44. display: flex;
  45. justify-content: space-between;
  46. padding: 40rpx 24rpx 0;
  47. background-color: #fff;
  48. }
  49. </style>