ie-safe-toolbar.vue 762 B

123456789101112131415161718192021222324252627282930
  1. <template>
  2. <view class="min-h-62" :style="{ minHeight: minHeight + 'px' }">
  3. <view class="safe-area-inset-bottom fixed left-0 bottom-0 right-0 z-10 box-border" :class="{ 'shadow-box': shadow }"
  4. :style="{ height: minHeight + 'px' }">
  5. <slot></slot>
  6. </view>
  7. </view>
  8. </template>
  9. <script lang="ts" setup>
  10. import { useAppStore } from '@/store/appStore';
  11. const appStore = useAppStore();
  12. const props = defineProps({
  13. height: {
  14. type: Number,
  15. default: 62
  16. },
  17. shadow: {
  18. type: Boolean,
  19. default: true
  20. }
  21. });
  22. const minHeight = computed(() => {
  23. return (appStore.systemInfo.safeAreaInsets?.bottom ?? 0) + props.height;
  24. });
  25. </script>
  26. <style lang="scss" scoped>
  27. .shadow-box {
  28. box-shadow: 0 -2px 8px 0 rgba(0, 0, 0, 0.05);
  29. }
  30. </style>