Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

FixedFooter.vue 893B

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