ie-safe-toolbar.vue 903 B

123456789101112131415161718192021222324252627282930313233343536373839
  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', backgroundColor: bgColor }">
  5. <slot></slot>
  6. </view>
  7. </view>
  8. </template>
  9. <script lang="ts" setup>
  10. defineOptions({
  11. options: {
  12. virtualHost: true
  13. }
  14. });
  15. import { useAppStore } from '@/store/appStore';
  16. const appStore = useAppStore();
  17. const props = defineProps({
  18. height: {
  19. type: Number,
  20. default: 62
  21. },
  22. shadow: {
  23. type: Boolean,
  24. default: true
  25. },
  26. bgColor: {
  27. type: String,
  28. default: '#FFFFFF'
  29. }
  30. });
  31. const minHeight = computed(() => {
  32. return (appStore.sysInfo.safeAreaInsets?.bottom ?? 0) + props.height;
  33. });
  34. </script>
  35. <style lang="scss" scoped>
  36. .shadow-box {
  37. box-shadow: 0 -2px 8px 0 rgba(0, 0, 0, 0.05);
  38. }
  39. </style>