gui-mp-menu-spacing.vue 580 B

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