top-title.vue 734 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <view class="title-box" :class="pageScroll > 140 ? 'scroll-style' : ''">
  3. {{titleValue}}
  4. </view>
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. name: "title-top",
  10. props: {
  11. titleValue: {
  12. type: String,
  13. default: '空i企',
  14. },
  15. pageScroll:{
  16. type:Number,
  17. default:0
  18. }
  19. },
  20. data() {
  21. return {};
  22. },
  23. methods: {
  24. },
  25. };
  26. </script>
  27. <style>
  28. .title-box {
  29. width: 100%;
  30. height: 80rpx;
  31. background: transparent;
  32. position: fixed;
  33. top: 40rpx;
  34. color: #fff;
  35. letter-spacing: 6rpx;
  36. z-index: 9999;
  37. text-align: center;
  38. font-weight: 550;
  39. line-height: 90rpx;
  40. }
  41. .scroll-style {
  42. background: #4AA5E4;
  43. top: 0;
  44. height: 145rpx;
  45. line-height: 160rpx;
  46. }
  47. </style>