status-bar-height.vue 518 B

12345678910111213141516171819202122232425
  1. <template>
  2. <view>
  3. <view :style="{ height: statusBarHeight }" class="status-bar-height"></view>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. data() {
  9. return {
  10. statusBarHeight: 20
  11. };
  12. },
  13. components: {},
  14. props: {},
  15. mounted() {
  16. this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
  17. },
  18. methods: {}
  19. };
  20. </script>
  21. <style>
  22. .status-bar-height {
  23. height: 20px;
  24. }
  25. </style>