gui-mp-navigation-spacing.vue 548 B

12345678910111213141516171819202122232425
  1. <template>
  2. <view
  3. class="gui-mp-navigation-spacing"
  4. :style="{width:width+'px'}"></view>
  5. </template>
  6. <script>
  7. export default{
  8. name : "gui-mp-navigation-spacing",
  9. data() {
  10. return {
  11. width: 0
  12. }
  13. },
  14. created:function(){
  15. // #ifdef MP
  16. let system = uni.getSystemInfoSync();
  17. let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
  18. this.width = menuButtonInfo.width + (system.windowWidth - menuButtonInfo.right);
  19. // #endif
  20. }
  21. }
  22. </script>
  23. <style scoped>
  24. .gui-navigation-spacing{width:0px; height:20px;}
  25. </style>