navbar.vue 967 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <view class="navbar">
  3. <view class="back">
  4. <text class="iconfont icon-fanhui " @click="backLast()"></text>
  5. </view>
  6. <slot></slot>
  7. </view>
  8. </template>
  9. <script>
  10. export default{
  11. name: 'navBar',
  12. methods:{
  13. backLast:function(){
  14. console.log(this.url)
  15. let pages=getCurrentPages()
  16. console.log(pages.length,'页面数组')
  17. uni.reLaunch({
  18. url:this.url
  19. })
  20. }
  21. }
  22. }
  23. </script>
  24. <style lang="scss">
  25. .navbar {
  26. font-size: 32upx;
  27. height: 100upx;
  28. line-height: 100upx;
  29. color: #888888;
  30. position: relative;
  31. position: fixed;
  32. top: 0;
  33. z-index: 9999999;
  34. width: 100%;
  35. background-color: #FFFFFF;
  36. text-align: center;
  37. border-bottom: solid 2upx #EFF1F6;
  38. .back {
  39. height: 100upx;
  40. width: 100upx;
  41. text-align: center;
  42. // background-color: #007AFF;
  43. position: absolute;
  44. float: left;
  45. left: 0upx;
  46. font-size: 32upx;
  47. }
  48. }
  49. </style>