app-iphone-x.vue 832 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <template>
  2. <view class="iphone-x">
  3. <slot name="empty-area"></slot>
  4. <view class="x-line" v-if="getBoolEmpty.XBoolean" :style="{height: getBoolEmpty.emptyHeight + 'rpx', backgroundColor: backgroundColor,}"></view>
  5. </view>
  6. </template>
  7. <script>
  8. import { mapGetters } from 'vuex';
  9. export default {
  10. props: {
  11. backgroundColor: {
  12. type: String,
  13. default: function() {
  14. return 'white';
  15. }
  16. }
  17. },
  18. computed: {
  19. ...mapGetters('iPhoneX', {
  20. getBoolEmpty: 'getBoolEmpty'
  21. }),
  22. }
  23. }
  24. </script>
  25. <style scoped lang="scss">
  26. .iphone-x {
  27. position: fixed;
  28. bottom: 0;
  29. left: 0;
  30. width: 100%;
  31. z-index: 1500;
  32. }
  33. .x-line {
  34. width: 100%;
  35. background-color: pink;
  36. }
  37. </style>