You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FixedFooter.vue 783B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <template>
  2. <view class="fixed-footer-box" :style="{height: height}">
  3. <view class="fixed-footer" :style="{zIndex: zIndex}">
  4. <slot></slot>
  5. </view>
  6. </view>
  7. </template>
  8. <script>
  9. export default {
  10. name: 'FixedFooter',
  11. options: {
  12. styleIsolation: 'shared' ,
  13. },
  14. props: {
  15. zIndex: {
  16. type: [Number, String],
  17. default: 10
  18. },
  19. height: {
  20. type: [String, Number],
  21. default: '144rpx'
  22. }
  23. }
  24. }
  25. </script>
  26. <style lang="scss" scoped>
  27. .fixed-footer-box{
  28. padding-bottom: calc(24rpx + env(safe-area-inset-bottom));
  29. }
  30. .fixed-footer{
  31. position: fixed;
  32. padding: 24rpx;
  33. padding-bottom: calc(24rpx + env(safe-area-inset-bottom));
  34. z-index: 10;
  35. bottom: 0;
  36. left: 0;
  37. width: 100%;
  38. box-sizing: border-box;
  39. background-color: #fff;
  40. border-top: 1px solid #eee;
  41. }
  42. </style>