TitleHeader.vue 945 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <view>
  3. <!-- #ifdef MP-WEIXIN -->
  4. <view class="navigation" :style="'height:'+navHeight+'px;line-height:'+navHeight+'px;'+(backgroundColor?('color:#fff;background-color:'+backgroundColor):'')">{{config.site_name}}</view>
  5. <!-- #endif -->
  6. </view>
  7. </template>
  8. <script>
  9. import {
  10. mapState,
  11. } from 'vuex'
  12. export default {
  13. name: 'flexLine',
  14. data() {
  15. return {
  16. navHeight: 0
  17. }
  18. },
  19. props: {
  20. backgroundColor: {
  21. type: String,
  22. default: ''
  23. }
  24. },
  25. computed: {
  26. ...mapState({
  27. config: state => state.config.config
  28. }),
  29. },
  30. methods: {
  31. },
  32. mounted: function() {
  33. // #ifdef MP-WEIXIN
  34. this.navHeight = uni.getMenuButtonBoundingClientRect().height
  35. // #endif
  36. },
  37. }
  38. </script>
  39. <style scoped lang="scss">
  40. .navigation {
  41. text-align: center;
  42. font-size: .7rem;
  43. background-color: #fff;
  44. }
  45. </style>